Documentation
¶
Index ¶
- func Admin() (admin.Admin, error)
- func Close()
- func Consumer() (rocketmq.PushConsumer, error)
- func Init() (err error)
- func NewAdmin(cfg config.RocketMQ) (admin.Admin, error)
- func NewProducer(cfg config.RocketMQ) (rocketmq.Producer, error)
- func NewPushConsumer(cfg config.RocketMQ, consumerGroup string) (rocketmq.PushConsumer, error)
- func Producer() (rocketmq.Producer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Consumer ¶
func Consumer() (rocketmq.PushConsumer, error)
Consumer returns the default RocketMQ consumer instance
func Init ¶
func Init() (err error)
Init initializes the global RocketMQ producer. It reads RocketMQ configuration from config.App.RocketMQ. If RocketMQ is not enabled, it returns nil. The function is thread-safe and ensures the producer is initialized only once.
func NewAdmin ¶
NewAdmin returns a new RocketMQ admin with given configuration. It's the caller's responsibility to close the admin when it's no longer needed.
func NewProducer ¶
NewProducer returns a new RocketMQ producer with given configuration. It's the caller's responsibility to start and shutdown the producer.
func NewPushConsumer ¶
NewConsumer returns a new RocketMQ push consumer with given configuration. It's the caller's responsibility to start and shutdown the consumer.
Types ¶
This section is empty.