camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xlogger <xloggers...@gmail.com>
Subject Apache Camel Splitter, Threadpool and JMS
Date Fri, 31 Jul 2015 01:44:15 GMT
I posted the question on stackoverflow 3 days ago but got no response so
far... repost here to see if anyone could advice on that. 
http://stackoverflow.com/questions/31645916/apache-camel-splitter-threadpool-and-jms 

==========
I have defined the following route in spring xml to split rows in a text
file and send each row to a JMS queue

<bean id="myPool" class="java.util.concurrent.Executors"
factory-method="newCachedThreadPool"/>

<camelContext id="concurrent-route-context"
xmlns="http://camel.apache.org/schema/spring" trace="true">
    <route id="inbox-threadpool-split-route">
        <from uri="{{inbox.uri}}" />
            <log message="Starting to process file: ${header.CamelFileName}"
/>
            <split streaming="true" executorServiceRef="myPool">
                <tokenize token="\n" />
                <to uri="{{inventory.queue.uri}}" />    
            </split>
            <log message="Done processing file: ${header.CamelFileName}" />
    </route>
</camelContext>

inbox.uri is a file component uri listening for file in a directory, while
inventory.queue.uri is a JmsComponent uri that connecting to a queue in JMS
server(Tibco EMS 6.X version). The JmsComponent uri is simple like
"JmsComponent:queue:?username=&password="

The above route can be run without error, but the rows splitted from file
are not sent to the queue as JMS message (i.e. the queue is still empty
after the program has run)

If I remove the executorServiceRef="myPool" from the splitter definition
(remaining definition like <split streaming="true"> only), the splitted
messages can be delivered to JMS queue one by one.

If I replace the "to" uri with a "direct" endpoint, then splitted messages
can be delivered no matter threadpool is used in splitter or not

Is there any special setting required in JmsComponent in order to make it
works with Splitter + threadpool? or any other configurations I have missed?



--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-Splitter-Threadpool-and-JMS-tp5770128.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message