apache / rocketmq-client-cpp

Apache RocketMQ cpp client
https://rocketmq.apache.org/
Apache License 2.0
370 stars 160 forks source link

How to set write queue number and read queue number? #438

Open T1anZhenYu opened 2 years ago

T1anZhenYu commented 2 years ago

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?

lizhanhui commented 2 years ago

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?

T1anZhenYu commented 2 years ago

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

lizhanhui commented 2 years ago

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);
T1anZhenYu commented 2 years ago

Thanks. I will check it out .