Closed he1016060110 closed 4 years ago
我看到consumeMessage传的msg引用
ConsumeStatus consumeMessage(const std::vector
once the RECONSUME_LATER return, all the messages in the vector will be sent back to the broker. you should do not change the message vectors. and more, Issues are generally used for bug reports and feature requests, so if you have any questions about Apache RocketMQ, it is recommended to discuss it on the mailing list first, the mailing list address. I will close the Issue first, but please feel free to reopen it if you have any other issues.
You can set consume batch size to 1 by DefaultMQPushConsumer::setConsumeMessageBatchMaxSize.
You can set consume batch size to 1 by DefaultMQPushConsumer::setConsumeMessageBatchMaxSize.
tried.the concurrency is so low.so i suggest that consumeMessage should contains two params,like solution below consumeMessage(const std::vector& msgs, std::vecotr & batchStatus) so that we can send message back according to the different status of every message of the batch.
@he1016060110 Call sendMessageBack by yourself, then return CONSUME_SUCCESS. But latest client not expose sendMessageBack in DefaultMQPushConsumer. Add it, and call DefaultMQPushConsumerImpl#sendMessageBack
@ShannonDing Can we expose sendMessageBack in DefaultMQPushConsumer?
IMO, It is not recommended to open this capability. In order to deal with simplicity and ensure the reliability and order as much as possible, the logic of sending back the broker is handled internally by the client and guarantees the success of the return. If this function is opened, it means that the failure to send back is uncontrollable, which increases the risk of message loss. In addition, if you don't want to report errors in batches, you can directly reply to CONSUMER_SUCCESS and re-deliver the failed message as a new message to this topic through a new independent producer.
I can do this ,although it's not elegant.And I still hold the point that there should be status vector param for consumeMessage.
对于DefaultMQPushConsumer,代码里面写死了maxNum为32,但是一次消费32条,部分成功,部分失败了,我该怎么在callback里面返回哪些消息成功,哪些需要reconsume,因为默认status只有一个,也就是要么全成功,要么全失败。