spring-cloud-alibaba Some questions of batch messages consumption

qfe3c7zg  于 2022-12-31  发布在  Spring
关注(0)|答案(1)|浏览(104)

Which Component
spring-cloud-stream-binder-rocketmq

Describe the solution you'd like
Support batch messages consumption.

Describe alternatives you've considered
When we would like to use batch messages consumption feature, we can set consumeMessageBatchMaxSize property to consumer , then consumer will pull a batch of messages on method consumeMessage of DefaultMessageListenerConcurrently or DefaultMessageListenerOrderly if message accumulation occurs. If one of this batch of messages throw an exception, the batch of messages would be sent to %RETRY% topic, it would cause Repeat Purchases. I have some ideas about this question.

  1. Set a header to message which have been consumed successfully, and filter messages by the property.
  2. Sign the index of the message which throw exception, and set the index to context by context.setAckIndex(index) . It needs to modify method processConsumeResult of class ConsumeMessageConcurrentlyService to set the number of retransmitted messages.
  3. Hand over the processing logic to the users.
zsohkypk

zsohkypk1#

please try the beta version #2029 to see if it solves your problem, or provide us more information to help find the latent bug.

相关问题