On Sun, Apr 20, 2008 at 8:45 AM, rmunjuluri <[EMAIL PROTECTED]> wrote: > > Hello, > > I have an input file with lines of input messages that I would like to send > to a JMS Endpoint. When I use the file:poller, it sends the entire file > (XML) as a JMS message to the JMSEndpoint. Is there a way for me to send > just one line at a time to read from the file and send each line as one > message to the JMS Endpoint?
This can be achieved by creating your own custom marshaler. See the DefaultConsumerMarshaler for an example. The idea with the marshalers is that they intercept the actual message before it is normalized and before an exchange is created. This allows you to do anything you like with the message before it's sent along to the actual component (in this case, the servicemix-jms component). Once you create your own marshaler class, you can plug it in using standard Spring syntax in the xbean.xml file. Below is an example xbean.xml file that plugs in a custom marshaler: ... <jms:consumer service="test:jmsIn" endpoint="jms" targetService="test:wiretapIn" targetEndpoint="endpoint" destinationName="TEST.FOO" marshaler="#myCustomMarshaler" connectionFactory="#pooledFactory" /> <bean id="myCustomMarshaler" class="com.mycompany.marshaler.MyCustomMarshaler"> <property name="mep" value="http://www.w3.org/2004/08/wsdl/in-out"/> </bean> <bean id="pooledFactory" class="org.apache.activemq.pool.PooledConnectionFactory"> <property name="connectionFactory" ref="connectionFactory" /> </bean> Bruce -- perl -e 'print unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' Apache ActiveMQ - http://activemq.org/ Apache Camel - http://activemq.org/camel/ Apache ServiceMix - http://servicemix.org/ Apache Geronimo - http://geronimo.apache.org/ Blog: http://bruceblog.org/