分辩哪个队列在Apache的骆驼使用通配符时

问题描述:

在我的申请,我正在使用Apache的骆驼通配符和我已经定义路线建设者这样叫:分辩哪个队列在Apache的骆驼使用通配符时

从(“ActiveMQ的:队列:* processQueue”) .bean(beanOne “的someMethod”);

虽然发送消息我会发短信给 “{} UNIQUEID .processQueue” 队列,所以我需要得到UNIQUEID的someMethodbeanOne

完整队列路径位于In消息的JMSDestination标头(例如JMS目标为queue://test1.processQueue)中。您可以使用字符串操作函数来获取所需的uniqueId

实施例(uniqueIdtest1):

@Handler 
public void someMethod(@Header("JMSDestination") String jmsDestination) { 
    String uniqueId = jmsDestination.substring("queue://".length(), jmsDestination.indexOf(".processQueue")); 
}