过去,我已经能够成功地将 Camel 连接到在 WebSphere 中公开为 JNDI 资源的消息队列 [1]。这适用于连接工厂。伟大的。
今天,我遇到了一种情况,系统管理员只提供了激活规范。无连接工厂。这是我们得到的:
- SIBus 名称:________
- 提供商端点:________
- 主题空间:Default.Topic.Space
- 消息引擎名称:________
- 主题名称:________
据我所知,激活规范适用于 MDB(消息驱动 Bean)。但是 Spring 有一些 ActivationSpec 的 API -- DefaultJmsActivationSpecFactory——所以我很乐观,我可以配置 Camel / Spring 来使用激活规范。我不确定这是否重要,但这是一辆带有外国巴士的 SIBus。
我的问题是:
有人有幸配置 Camel 与激活规范进行通信吗?
另请参阅:
[1] 作为参考,这里是我们来之不易的 Camel 配置,它通过 JNDI 资源(连接工厂)将 Camel 连接到消息队列。由于我们必须在几乎没有文档的情况下将此配置拼凑在一起,因此我希望可以为 Activation Spec 完成类似的配置。
<jee:jndi-lookup id="myTargetConnectionFactory" jndi-name="${mq.jndi-name}"/>
<bean id="jmsDestResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver"/>
<bean id="myConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="myTargetConnectionFactory"/>
<property name="username" value="${mq.username}"/>
<property name="password" value=""/>
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="myConnectionFactory" />
<property name="destinationResolver" ref="jmsDestResolver" />
<property name="concurrentConsumers" value="1" />
<property name="maxConcurrentConsumers" value="10" />
<property name="cacheLevelName" value="CACHE_NONE" />
</bean>
In the past, I've been able to successfully connect Camel to a Message Queue exposed as a JNDI resource in WebSphere [1]. This works with a Connection Factory. Great.
Now today, I have a situation where sys admins have only provided an Activation Specification. No Connection Factory. Here's what we've got:
- SIBus name: ________
- Provider endpoint: ________
- Topic space: Default.Topic.Space
- Messaging Engine Name: ________
- Topic name: ________
From what I've read, Activation Specification is intended for MDBs (Message Driven Beans). But Spring has some APIs for ActivationSpec -- DefaultJmsActivationSpecFactory, for example -- so I'm optimistic I can configure Camel / Spring to work with an Activation Specification. I'm not sure that it matters, but this is an SIBus with a foreign bus.
My question is:
Has anyone had any luck configuring Camel to communicate with an Activation Specification?
See also:
[1] For reference, here's our hard-won Camel config that connects Camel to a Message Queue via a JNDI resource (Connection Factory). Since we had to piece this config together with almost no documentation, I'm hoping a similar config can be done for Activation Spec.
<jee:jndi-lookup id="myTargetConnectionFactory" jndi-name="${mq.jndi-name}"/>
<bean id="jmsDestResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver"/>
<bean id="myConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="myTargetConnectionFactory"/>
<property name="username" value="${mq.username}"/>
<property name="password" value=""/>
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="myConnectionFactory" />
<property name="destinationResolver" ref="jmsDestResolver" />
<property name="concurrentConsumers" value="1" />
<property name="maxConcurrentConsumers" value="10" />
<property name="cacheLevelName" value="CACHE_NONE" />
</bean>
发布评论