Thanks for the reply. But I have a publish-subscribe channel and in tht case how can I use "poller"??
Code:
<message-bus/>
<publish-subscribe-channel id="sendChannel"/>
<!-- The service activator receives from the 'sendChannel',invokes the handler, and sends the reply Message to the 'replyChannel'. -->
<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="mailChannel"/>
<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="jmsChannel"/>
<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="consoleChannel"/>
<!-- The handler invokes the WebService for the given URI and returns a reply Message. -->
<ws-handler id="msgConverter1" uri="http://localhost:8080/Trial1/companyservice"/>
<!-- The response from the service is sent to different target adapters. -->
<channel-adapter id="consoleChannel" target="console"/>
<console-target id="console"/>
<channel-adapter id="mailChannel" target="mailTarget"/>
<mail-target id="mailTarget" header-generator="mailHeader" username="root" password="root" host="localhost" />
<beans:bean id="mailHeader" class="org.springframework.integration.adapter.mail.StaticMailHeaderGenerator">
<beans:property name="to" value="black@localhost" />
<beans:property name="subject" value="Test Mail" />
<beans:property name="from" value="white@localhost"/>
<beans:property name="replyTo" value="black@localhost"/>
</beans:bean>
<channel-adapter id="jmsChannel" target="jmsTarget"/>
<jms-target id="jmsTarget" connection-factory="connectionFactory" destination="destination"/>
<beans:bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<beans:property name="brokerURL" value="tcp://localhost:61616" />
</beans:bean>
<beans:bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
<beans:constructor-arg index="0" value="HelloJMS"/>
</beans:bean>
</beans:beans>