Spring integration 如何在包含入站适配器、出站适配器和错误通道的流中处理jms会话,并使用相同的CachingConnectionfactory进行配置
我有以下流程:Spring integration 如何在包含入站适配器、出站适配器和错误通道的流中处理jms会话,并使用相同的CachingConnectionfactory进行配置,spring-integration,spring-jms,Spring Integration,Spring Jms,我有以下流程: 1) message-driven-channel-adapter -> 1.1) output-channel connected to -> service-activator -> outbound-channel-adapter (for sending response) 1.2) error-channel connected to -> exception-type-router
1) message-driven-channel-adapter ->
1.1) output-channel connected to -> service-activator -> outbound-channel-adapter (for sending response)
1.2) error-channel connected to -> exception-type-router
1.2.1) message is sent to different queues depending on the exception type using outbound-channel-adapter
MessageDrivenChannelAdapter uses DefaultMessageListenrContainer and OutboundAdapter uses JMSTemplate
Have used same cachingconnectionfactory for inbound and outbound adapters,
set acknowledge="transacted" in messageDrivenChannelAdapter
set cacheLevel as CACHE_CONSUMER in DefaultMessageListenerContainer
set cacheProducers=true and cacheConsumers=false in CachingConnectionFactory
在这个流程中如何创建和处理jms会话/生产者/消费者,我感到非常困惑
1) 入站适配器、出站适配器(用于响应和错误队列)使用的使用者和生产者是否从同一会话创建,即线程中使用的生产者和使用者是否从同一会话创建
2) 只是想确认使用cachingconnectionfactory是否存在任何缺点/问题,即使在工厂中将1)cacheconmers设置为false,并将2)缓存级别设置为在DefaultMessageListenerContainer中缓存消费者。因为,读到论坛上说不应该使用cachingconnectionfactory是令人困惑的
3) 另外,对执行流有疑问:在执行流中,service activator方法的执行何时完成?它是否仅在消息发送到输出队列后完成
请告知
acknowledgemode
被处理时,容器会话被绑定到线程,并将被配置为使用相同连接工厂的任何上游JmsTemplate
使用,只要不存在异步切换(QueueChannel
或ExecutorChannel
);默认的DirectChannel
在容器线程上运行下游端点
在将消息发送到出站适配器之前,将调用(并“完成”)service activator方法。Gary,感谢您的详细解释。