Versions in this module Expand all Collapse all v2 v2.2.0 Nov 22, 2020 Changes in this version + var ErrMessageEmpty = errors.New("message is nil") + var ErrNotRunning = errors.New("producer not started") + var ErrTopicEmpty = errors.New("topic is nil") + func MarshalMessageBatch(msgs ...*primitive.Message) []byte + func NewDefaultProducer(opts ...Option) (*defaultProducer, error) + func NewTransactionProducer(listener primitive.TransactionListener, opts ...Option) (*transactionProducer, error) + type Option func(*producerOptions) + func WithCreateTopicKey(topic string) Option + func WithCredentials(c primitive.Credentials) Option + func WithDefaultTopicQueueNums(queueNum int) Option + func WithGroupName(group string) Option + func WithInstanceName(name string) Option + func WithInterceptor(f ...primitive.Interceptor) Option + func WithNameServer(nameServers primitive.NamesrvAddr) Option + func WithNameServerDomain(nameServerUrl string) Option + func WithNamespace(namespace string) Option + func WithNsResovler(resolver primitive.NsResolver) Option + func WithQueueSelector(s QueueSelector) Option + func WithRetry(retries int) Option + func WithSendMsgTimeout(duration time.Duration) Option + func WithTrace(traceCfg *primitive.TraceConfig) Option + func WithVIPChannel(enable bool) Option + type QueueSelector interface + Select func(*primitive.Message, []*primitive.MessageQueue) *primitive.MessageQueue + func NewHashQueueSelector() QueueSelector + func NewManualQueueSelector() QueueSelector + func NewRandomQueueSelector() QueueSelector + func NewRoundRobinQueueSelector() QueueSelector