camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Multiple JPA Consumers
Date Tue, 02 Mar 2010 06:05:26 GMT
On Mon, Mar 1, 2010 at 11:43 PM, vcheruvu <vid.cheruvu@macquarie.com> wrote:
>
> Apologies, I did not clearly explain in the previous post.
>
> Basically I am trying to see how can I can have  multiple consumers at same
> JPA endpoint.  So, multiple consumers will poll the table where each
> consumer will get next 100 records.   I am treating the table as a queue
> using readpast select query and update rows that are processed.
>
> So how can I achieve concurrent consumers on this endpoint
>
> jpa:com.MyEntity?consumer.namedQuery=pollRecords&amp;consumeDelete=false&amp;delay=3000
>

The JPA component does not support concurrent consumers out of the box.

You can define multiple routes in the camel context and thus still
have concurrent consumers.



>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> I assume you are talking about having concurrent JPA consumers on the
>> same JPA endpoint?
>>
>> eg you want this one:
>> jpa:com.MyEntity?consumer.namedQuery=pollRecords&amp;consumeDelete=false&amp;delay=3000
>>
>> To have concurrent threads processing it?
>> If not what are you talking about?
>>
>>
>>
>> On Mon, Mar 1, 2010 at 8:05 AM, vcheruvu <vid.cheruvu@macquarie.com>
>> wrote:
>>>
>>> How can i define multiple JPA consumers in CAMEL? I have managed to
>>> create
>>> another camel context which is duplicate of below camelContext segment
>>> except id is named as camel2.  This duplicate segment worked but i like
>>> to
>>> have a way where I can  define number of consumers without having
>>> duplicate
>>> the camelContext code. I looked at Seda and VM but didn't know how to
>>> define
>>> "from".  Can you please advise how I can add multiple consumers for JPA
>>> in
>>> Camel? Thanks in advance.
>>>
>>>        <camelContext id="camel"
>>> xmlns="http://camel.apache.org/schema/spring">
>>>        <package>com.mbl</package>
>>>        <jmxAgent id="agent" createConnector="true" />
>>>                <route>
>>>                        <from
>>> uri="jpa:com.MyEntity?consumer.namedQuery=pollRecords&amp;consumeDelete=false&amp;delay=3000"/>
>>>                        <convertBodyTo type="com.MyEntity"/>
>>>                        <to
>>> uri="bean:transformerBean?method=transformOrder"/>
>>>
>>>                </route>
>>>   </camelContext>
>>>
>>> <bean id = "transformerBean" class
>>> ="com.transformation.OrderTransformation"
>>> />
>>>
>>>
>>> Kind regards,
>>> -Vid-
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Multiple-JPA-Consumers-tp27740630p27740630.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Multiple-JPA-Consumers-tp27740630p27750074.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message