rocketmq
rocketmq copied to clipboard
Make sure the list of message queues is not null before using selecting a queue. in orderly message sending example.
in example/ordermessage/producer.java. make sure message queue is not null before using selecting a queue.
SendResult sendResult = producer.send(msg, new MessageQueueSelector() {
@Override
public MessageQueue select(List<MessageQueue> mqs, Message msg, Object arg) {
Integer id = (Integer) arg;
int index = id % mqs.size();
return mqs.get(index);
}
}, orderId);
if the mqs is null, mqs.size() may be crash.
please assign this work to me.
please assign this work to me.
Welcome. assigned.
ping @clbigdata
@ShannonDing
The main process of sending message is in method org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendSelectImpl
.
The topicPublishInfo.ok()
is called before calling MessageQueueSelector#select
, what any else situation will cause the empty message queue list?
@devfat you are right
So, this issue can be closed,right?
So, this issue can be closed,right?
@ShannonDing