Documentation ¶
Index ¶
- Constants
- func GetTagString(tag *string) string
- func MixTags(tags ...string) string
- func NewProducer(logConfig *LogConfig, config *rmq_client.Config) (rmq_client.Producer, error)
- func NewSimpleConsumer(logConfig *LogConfig, config *rmq_client.Config, ...) (rmq_client.SimpleConsumer, error)
- func SendMessage(producer rmq_client.Producer, topic string, body []byte, tag *string, ...) (*rmq_client.SendReceipt, error)deprecated
- func SendMessageForSendReceipts(producer rmq_client.Producer, topic string, body []byte, tag *string, ...) ([]*rmq_client.SendReceipt, error)deprecated
- func VerifyEndpoint(endpoint, topic string) error
- type Config
- type LogConfig
Constants ¶
View Source
const ( // AwaitDuration (consumer创建实例时用到) maximum waiting time for receive func AwaitDuration = time.Second * 5 // MaxMessageNum (consumer收消息时用到) maximum number of messages received at one time MaxMessageNum int32 = 16 // InvisibleDuration (consumer收消息时用到) InvisibleDuration should > 20s InvisibleDuration = time.Second * 20 )
Variables ¶
This section is empty.
Functions ¶
func GetTagString ¶
func NewProducer ¶
func NewProducer(logConfig *LogConfig, config *rmq_client.Config) (rmq_client.Producer, error)
NewProducer
@param logConfig 可以为nil @return rmq_client.Producer实例要手动调用 Start()!!!
func NewSimpleConsumer ¶
func NewSimpleConsumer(logConfig *LogConfig, config *rmq_client.Config, consumerGroup, topic, tag string) (rmq_client.SimpleConsumer, error)
NewSimpleConsumer
@param logConfig 可以为nil(此时将默认输出到控制台) @param config 不会修改传参config,因为修改的是副本 @return rmq_client.SimpleConsumer实例要手动调用 Start()!!!
func SendMessage
deprecated
func SendMessage(producer rmq_client.Producer, topic string, body []byte, tag *string, keys ...string) (*rmq_client.SendReceipt, error)
SendMessage
Deprecated: 此方法仅供参考.
@param tag 可以为nil
func SendMessageForSendReceipts
deprecated
func SendMessageForSendReceipts(producer rmq_client.Producer, topic string, body []byte, tag *string, keys ...string) ([]*rmq_client.SendReceipt, error)
SendMessageForSendReceipts
Deprecated: 此方法仅供参考.
func VerifyEndpoint ¶
VerifyEndpoint 测试RocketMQ5服务是否启动正常.
@param endpoint 用于测试的RocketMQ5服务的endpoint @param topic 用于测试的topic(理论上,此topic仅用于测试,不能同时用于业务,因为测试发的消息无意义) @return 如果为nil,说明 RocketMQ5服务 正常启动
Types ¶
type Config ¶
type Config struct { rmq_client.Config TopicToVerify string }
Click to show internal directories.
Click to hide internal directories.