我已经定义了一个 Route
,它消耗来自队列的消息没有任何问题,现在我正在尝试使用已经在队列中的消息12小时,我有想法使用 selector
,但不知道如何使用它与 JMSTimestamp
符合12小时标准 .
这是 Route
:
<route id="INBOUND.RECEIVE.IN">
<from
uri="activemq:queue:QXL.INBOUND.RECEIVE.IN?selector=JMSTimestamp%3D${date.time}&concurrentConsumers=10&destination.consumer.prefetchSize=0&deliveryPersistent=true&username=admin01&password=001!admin01001!" />
<pipeline>
<bean method="inboundReceive" ref="logipalServices"/>
</pipeline>
</route>
这是日期bean
<bean id="date" class="java.util.Date" scope="prototype"/>
1 回答
根据您的解释, I think something is wrong with your selector .
JMSTimestamp%3D${date.time}
表示JMSTimestamp = ${date.time}
这意味着您正在使用 exact
JMSTimestamp
查找所有消息 . 由于Date.getTime()以毫秒为单位返回时间,因此您不太可能从队列中检索任何消息 .我想你应该尝试类似的东西:
我希望这能帮到您 .