Use this skill to implement RabbitMQ consumers and infrastructure. It provides templates for creating type-safe consumers and setting up the listening engine with OpenTelemetry support.
This skill provides patterns for robust RabbitMQ consumer implementation.
Create a new consumer in listener/ (or internal/mq/) using the template.
Template Usage:
templates/consumer.go.tmpllistener/{{CONSUMER_NAME_LOWER}}.go{{PACKAGE_NAME}}: Package name (e.g., listener){{MODULE_NAME}}: Go module name{{CONSUMER_NAME}}: Consumer struct name (e.g., MatchStatus){{MESSAGE_TYPE}}: Struct type of the message (e.g., types.MatchMsg){{QUEUE_NAME}}: Queue nameIn main.go or listener/listener.go (if creating a separate service):
// Create consumer instance
consumer := New{{CONSUMER_NAME}}Consumer(ctx, svcCtx)
// Create listener wrapper
l := rabbitmq.NewListener[types.MatchMsg](consumer)
// Start listener
l.Start()
If infra/rabbitmq/ does not exist, use templates/infra.go.tmpl (or copy detailed implementation from SKILL Reference) to create the base listener engine.
templates/consumer.go.tmpl: Standard typed consumer handler.templates/infra.go.tmpl: Infrastructure skeleton (refer to SKILL.md text for full impl if not using library).