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

How to set write queue number and read queue number?

Open T1anZhenYu opened this issue 3 years ago • 4 comments

I want the producer to specify the read/write queue number when it sends a message about a new topic. But in Example, there is no relevant use case. How should I set it?

T1anZhenYu avatar Aug 14 '22 08:08 T1anZhenYu

The number of queues/partitions of a topic is decided and persisted on topic creation. Is your use case to use only a subset of available queues or change the number of the queues a topic has dynamically?

lizhanhui avatar Aug 15 '22 02:08 lizhanhui

When I create a new consumer, I only want a subset of available queues. How can I set it?

T1anZhenYu avatar Aug 15 '22 03:08 T1anZhenYu

When I create a new consumer, I only want a subset of available queues. How can I set it?

I assume you are referring to Producer as the first comment. Yes, you can decide which queue to publish to when delivering a message. Use the one with QueueSelector

  virtual SendResult send(MQMessage& msg, MessageQueueSelector* selector, void* arg);

lizhanhui avatar Aug 15 '22 03:08 lizhanhui

Thanks. I will check it out .

T1anZhenYu avatar Aug 15 '22 03:08 T1anZhenYu