Java 区分在apache camel中使用通配符时调用的队列

Java 区分在apache camel中使用通配符时调用的队列,java,apache-camel,activemq,wildcard,consumer,Java,Apache Camel,Activemq,Wildcard,Consumer,在我的应用程序中,我在apache camel中使用通配符,并定义了如下路由生成器: from(“activemq:queue:*.processQueue”).bean(beanOne,“someMethod”) 在发送消息时,我会将消息发送到“{uniqueID}.processQueue”队列,因此我需要在beanOne的someMethod中获取uniqueID,完整队列路径在消息的JMSDestination头中(例如,JMSDestination是queue://test1.proc

在我的应用程序中,我在apache camel中使用通配符,并定义了如下路由生成器:

from(“activemq:queue:*.processQueue”).bean(beanOne,“someMethod”)


在发送消息时,我会将消息发送到“{uniqueID}.processQueue”队列,因此我需要在beanOne的someMethod中获取uniqueID

完整队列路径在
消息的
JMSDestination
头中(例如,JMSDestination是
queue://test1.processQueue
)。您可以使用字符串操作函数获取所需的
唯一ID

示例(
uniqueId
将是
test1
):


完整队列路径位于
消息的
JMSDestination
头中的
(例如,JMSDestination是
queue://test1.processQueue
)。您可以使用字符串操作函数获取所需的
唯一ID

示例(
uniqueId
将是
test1
):

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