camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gnani swami <projectnash1...@gmail.com>
Subject Are there any Camel hack to make all the JMS component to use one and only thread?
Date Thu, 05 Sep 2013 16:02:16 GMT
Hi,

Camel was wonderful piece of software and using it in production for more
than a year.  Our version of Camel was 2.10.1

I recently added few additional route (and bug in buz logic too) to
interface with additional systems, all the routes are doing the similar
job. They read JMS message from an unique-end-point (MQ JMS Queue) and
invoke buzComponent (Camel component).

But recently discovered that some subtle concurrency issues inside the
buzComponent causing trouble to us. And I am looking for some sort of Camel
hack to prevent it from further damage by making all the end-point consumer
to use one and only thread.

1) As a short term solution, we like to convert all the JMS component to
use single threaded threadPool (or taskExecutor), and that new thread pool
shouldn't allow more than a thread across all the JMS end-point.  Is it
possible?  We are not worried about latency and performance for some time.

2) if there is a possibility, our camel error handlers were already
in-place, Can we assume that single thread would continue working despite
any exception configured to errorHandler. ErrorHandlers will have its own
thread.

3) I am also happy to introduce one or more route and end-point inside
camelcontex.xml, so all the buzComponent can be redirected into that new
route to make it SingleThreaded execution somehow.. are there any
suggestion to use some  camel component (We could use any hack as long as
configurable inside xml).

I am pretty sure all the above approach may be short sighted, but looking
for temporary solution which could work for few days. We are happy to
modify Camel xml, than changing code and making it complex.

I appreciate feedback.

Regards
Mohan

<camelContext>
    <route id="route-one">
            <from uri="ibmmq1:queue:fromSourceOne" />
            <inOnly uri="direct://buzComponent" />
    </route>
    <route id="route-two">
            <from uri="ibmmq2:queue:fromSourceTwo" />
            <inOnly uri="direct://buzComponent" />
    </route>
    <!-- problematic root due to buzComponent locking-->
    <route id="high-speed-source-source-3">
            <from uri="ibmmq3:queue:fromHighSpeedSourceOne" />
            <inOnly uri="direct://buzComponent" />
    </route>
    <route id="high-speed-source-source-4">
            <from uri="ibmmq4:queue:fromHighSpeedSourceTwo" />
            <inOnly uri="direct://buzComponent" />
    </route>
</camelContext>

<bean id="ibmmq" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory">
        <bean class="com.ibm.mq.jms.MQConnectionFactory">
        ...
        </bean>
    </property>
</bean>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message