rocketmq-client-go icon indicating copy to clipboard operation
rocketmq-client-go copied to clipboard

Why does the RocketMQ Java client SDK let transaction producers and normal producers share the same defaultMQProducerImpl for sending messages, while the Go SDK requires creating two separate defaultMQProducerImpl instances?

Open great123456-1 opened this issue 1 year ago • 1 comments

在Go版本里面 NewTransactionProducer 和 NewProducer 会创建出2个defaultProducer JAVA 创建一个事务生产者 就可以同时发送普通和事务消息,Go里面非得创建2个这是为啥呢

great123456-1 avatar Sep 24 '25 05:09 great123456-1

func NewProducer(opts ...producer.Option) (Producer, error) {
	return producer.NewDefaultProducer(opts...)
}

func NewTransactionProducer(listener primitive.TransactionListener, opts ...producer.Option) (TransactionProducer, error) {
	return producer.NewTransactionProducer(listener, opts...)
}

great123456-1 avatar Sep 24 '25 05:09 great123456-1