dimanche 5 avril 2015

storing the message of a queue in a text file

I have written below spring integration program in which i am trying to read messages from queue named tre.vrtv.wer.test.ewqt and then store the messages in a file in c: drive of my computer in a folder named message and inside message folder there is a file output.txt


as if the file is not created then it will create a new file whose name will be output.txt but rite now the file is not prepared , can you please advise what went wrong how can i overcome from this , when i execute this application the folder named message is created inside C: drive of my computer but there is no output.txt file is not created



<int:channel id="output" >

</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">http://tcplbc.net:3433</prop>
<prop key="java.naming.security.principal">ert</prop>
<prop key="java.naming.security.credentials">tre</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>tre.vrtv.wer.test.ewqt</value>
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
<property name ="receiveTimeout">
<value>120000</value>
</property>
</bean>


<int:channel id="input">

</int:channel>

<jms:outbound-channel-adapter channel="input" destination-name="tre.vrtv.wer.test.ewqt" connection-factory="tibcoEMSConnFactory" />

<jms:message-driven-channel-adapter channel="filesIn" concurrent-consumers="2" destination-name="tre.vrtv.wer.test.ewqt" connection-factory="tibcoEMSConnFactory" />

<file:outbound-channel-adapter id="filesIn" auto-create-directory="true"
directory="c:\\message\\output.txt">
</file:outbound-channel-adapter>

Aucun commentaire:

Enregistrer un commentaire