ferrirW commented on code in PR #194:
URL: https://github.com/apache/rocketmq-mqtt/pull/194#discussion_r1220737918
##########
mqtt-cs/src/main/java/org/apache/rocketmq/mqtt/cs/session/infly/PushAction.java:
##########
@@ -163,6 +167,9 @@ public void write(Session session, Message message, int
mqttId, int qos, Subscri
if (subscription.isRetry()) {
message.setRetry(message.getRetry() + 1);
logger.warn("retryPush:{},{},{}", session.getClientId(),
message.getMsgId(), message.getRetry());
+ } else if (subscription.isShare()) {
+ String lmqTopic = MixAll.LMQ_PREFIX +
StringUtils.replace(message.getOriginTopic(), "/","%");
+ lmqQueueStore.popAck(lmqTopic, subscription.getSharedName(),
message);
Review Comment:
> Why do you return ack directly after writing here? Isn’t it a success when
the client returns ack?
I didn't quite get your question, But Now, just like you said, the popAck is
performed after the client returns?
Or do you want to ack only when the future.isSuccess()?
Another consideration: return popAck here is to ensure that the message is
delivered to the consumer, otherwise the message may be lost if it is ack
immediately after receiving the pop message
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]