【发布时间】:2019-11-12 09:48:49
【问题描述】:
我正在设计一个简单的系统,其流程将是这样的:
Message Producer Microservice --> Active MQ --> Message Consumer Microservice --> Mongo DB
我需要设计一种排队策略,以便在 MongoDB 宕机时,我不应该丢失消息(因为消息使用者会将消息出列)。
我的消费者是这样写的:
@JmsListener(destination = "Consumer.myconsumer.VirtualTopic.Tracking")
public void onReceiveFromQueueConsumer2(TrackingRequest trackingRequest) {
log.debug("Received tracking request from the queue by consumer 2");
log.debug(trackingRequest.toString());
}
您如何提供客户确认?
【问题讨论】:
-
@JustinBertram 我已经更新了这个问题以更清楚地说明问题。问题是,如果 MongoDB 宕机,我们如何在可能几个小时后处理相同的消息?
标签: spring-boot error-handling activemq