【发布时间】:2016-06-02 05:28:24
【问题描述】:
我有以下配置,它连接到一个队列,该队列基本上是一个 tibco 队列,并将一条消息放入队列中,现在我还想将它增强到接收器部分
我想创建一个单独的 xml 配置,其中 jms 适配器将连接到 tibco 消息代理并使用来自同一队列的消息并将该消息写入文本文件并将该文本文件存储在我的 C 驱动器中,请告知该配置将如何
对于发件人部分,我有以下配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:jms="http://www.springframework.org/schema/integration/jms"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.apress.prospringintegration" />
<int:poller id="poller" default="true" >
<int:interval-trigger interval="200"/>
</int:poller>
<int:channel id="input">
<int:queue capacity="10"/>
</int:channel>
<bean id="tibcoEMSJndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactory</prop>
<prop key="java.naming.provider.url">tcp://werems1.fm.absgrp.net:5678</prop>
<prop key="java.naming.security.principal">xyz</prop>
<prop key="java.naming.security.credentials">xyz</prop>
</props>
</property>
</bean>
<bean id="tibcoEMSConnFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="tibcoEMSJndiTemplate" />
</property>
<property name="jndiName">
<value>GenericConnectionFactory</value>
</property>
</bean>
<bean id="tibcosendJMSTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<ref local="tibcoEMSConnFactory" />
</property>
<property name="defaultDestinationName">
<value>qwert.dev.queue.test.data</value>
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
<property name ="receiveTimeout">
<value>120000</value>
</property>
</bean>
<jms:outbound-channel-adapter channel="input" destination-name="qwert.dev.queue.test.data" connection-factory="tibcoEMSConnFactory" />
</beans>
【问题讨论】:
标签: java jms spring-integration