rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

DefaultLitePullConsumerImpl cannot continue to use the seek method after customizing the MessageQueueListener

Open sunxiaojian opened this issue 3 years ago • 0 comments

RocketMQ verison : 4.7.0

  1. The seek method in DefaultLitePullConsumerImpl defaults to the rebrance method. However, if I want to customize the MessageQueueListener, it seems that I cannot use the seek method. The subscription partition in AssignedMessageQueue cannot be reset because the AssignedMessageQueue variable in DefaultLitePullConsumerImpl is not public. Can you consider adding a method to get this information? When customizing MessageQueueListener, you can continue to use the seek method

default MessageQueueListener : image seek method : image

  1. Now setMessageQueueListener must be overwritten after the subscribe method, otherwise it will be overwritten by default, which is easy to cause confusion

image

sunxiaojian avatar Aug 10 '22 06:08 sunxiaojian

Hi @sunxiaojian You can add a public method to get the AssignedMessageQueue.

RongtongJin avatar Aug 12 '22 02:08 RongtongJin

Hi @sunxiaojian You can add a public method to get the AssignedMessageQueue.

OK

Another question is whether an interface can be added to submit the offset specified by the MessageQueue Let DefaultLitePullConsumerImpl.updateConsumeOffset is open in DefaultLitePullConsumer

image

sunxiaojian avatar Aug 12 '22 02:08 sunxiaojian

Member

Maybe DefaultLitePullConsumer.commit(final Set<MessageQueue> messageQueues, boolean persist) can meet your needs.

ni-ze avatar Aug 15 '22 01:08 ni-ze

Member

Maybe DefaultLitePullConsumer.commit(final Set messageQueues, boolean persist) can meet your needs.

DefaultLitePullConsumer.commit can't specify offset. I provided PR for support. Can you help review it? https://github.com/apache/rocketmq/pull/4820

sunxiaojian avatar Aug 15 '22 02:08 sunxiaojian