Spring boot 使用自定义JMS侦听器';s";“集装箱工厂”;走骆驼路线

Spring boot 使用自定义JMS侦听器';s";“集装箱工厂”;走骆驼路线,spring-boot,apache-camel,spring-jms,Spring Boot,Apache Camel,Spring Jms,我希望使用驼峰路由接收消息,但是能够以某种方式注入自定义的“containerFactory” 通常(没有骆驼路线),您会执行以下操作: @JmsListener(destination=“${some.virtual topic.queue}”, containerFactory=“customJmsListenerContainerFactory”) public void receiveMessage(字符串消息)引发异常{ //对收到的消息做一些冷静的处理。。。 } 注意上面“JmsL

我希望使用驼峰路由接收消息,但是能够以某种方式注入自定义的“containerFactory”

通常(没有骆驼路线),您会执行以下操作:

@JmsListener(destination=“${some.virtual topic.queue}”,
containerFactory=“customJmsListenerContainerFactory”)
public void receiveMessage(字符串消息)引发异常{
//对收到的消息做一些冷静的处理。。。
}
注意上面“JmsListener”注释的“containerFactory”属性如何为我们提供了一种使用非默认“containerFactory”的方法。这很好,但是如果我们想使用驼峰路径从队列中读取,该怎么办?比如:

@组件
公共类TestRoute扩展了RouteBuilder{
@凌驾
public void configure()引发异常{
from(“activemq:queue:{{some.virtualtopic.queue}}”)
.bean(MessageFacade.class,“进程”);
} 
}
在上面的最新案例中,我无法“注入”定制JMS containerFactory。有人知道这是否可能(以非黑客方式)吗?否则,我们将不得不依赖标准侦听器。

请参阅文档:


选项
consumerType
应设置为
Custom
messageListenerContainerFactory
应参考容器工厂实现的bean id。

Claus非常感谢您为我提供相关文档,甚至建议解决方案!祝您有个美好的一天