You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qq31715879 (via GitHub)" <gi...@apache.org> on 2023/10/16 11:49:44 UTC
[I] 手动触发重新消费, 不走ConsumeMessageHook [rocketmq-spring]
qq31715879 opened a new issue, #589:
URL: https://github.com/apache/rocketmq-spring/issues/589
手动触发重新消费消息
org\apache\rocketmq\client\impl\ClientRemotingProcessor.java
@Override
public RemotingCommand processRequest(ChannelHandlerContext ctx,
RemotingCommand request) throws RemotingCommandException {
switch (request.getCode()) {
case RequestCode.CHECK_TRANSACTION_STATE:
return this.checkTransactionState(ctx, request);
case RequestCode.NOTIFY_CONSUMER_IDS_CHANGED:
return this.notifyConsumerIdsChanged(ctx, request);
case RequestCode.RESET_CONSUMER_CLIENT_OFFSET:
return this.resetOffset(ctx, request);
case RequestCode.GET_CONSUMER_STATUS_FROM_CLIENT:
return this.getConsumeStatus(ctx, request);
case RequestCode.GET_CONSUMER_RUNNING_INFO:
return this.getConsumerRunningInfo(ctx, request);
case RequestCode.CONSUME_MESSAGE_DIRECTLY:
return this.consumeMessageDirectly(ctx, request);
case RequestCode.PUSH_REPLY_MESSAGE_TO_CLIENT:
return this.receiveReplyMessage(ctx, request);
default:
break;
}
return null;
}
此方法consumeMessageDirectly, 没有源码内有走ConsumeMessageHook
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 手动触发重新消费, 不走ConsumeMessageHook [rocketmq-spring]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #589:
URL: https://github.com/apache/rocketmq-spring/issues/589#issuecomment-5431167034
**Issue Evaluation**
Category: `question` | Status: **Evaluated**
The question is about why manually triggered message reconsumption does not go through `ConsumeMessageHook`.
**Explanation:**
`ConsumeMessageHook` is invoked by the consumer's `ConsumeMessageConcurrentlyService` / `ConsumeMessageOrderlyService` during the normal consumption pipeline. When messages are re-delivered via broker-side mechanisms (e.g., `sendMessageBack`), they re-enter the normal consumption pipeline and hooks are triggered.
However, if you are manually triggering reconsumption through `ClientRemotingProcessor` or admin tools, the request bypasses the consumer's standard consumption pipeline, which is why `ConsumeMessageHook` is not invoked.
**Suggestion:** If you need hooks to be triggered during manual reconsumption, consider using the consumer's `sendMessageBack` API instead of direct broker admin commands, as it goes through the proper consumption flow.
---
*Automated evaluation by github-manager*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org