You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Łukasz Budnik <lu...@gmail.com> on 2010/06/17 10:51:42 UTC
automatically restarting route (from + activemq)?
Hi all,
I'm new to Camel and I'm evaluating it.
I have a simple scenario: I want to consume messages from a remote Active MQ:
<route>
<from uri="remoteactivemq:queue:remotequeue" />
<to uri="file:target/messages/remotequeue" />
</route>
Everything works fine until I kill Active MQ. Camel disconnects from
ActiveMQ. When the ActiveMQ is started again, new messages are not
being consumed. Route is a zombie, it is started but not active any
more.
How to solve this problem?
thanks,
Łukasz
Re: automatically restarting route (from + activemq)?
Posted by agentalpha <yo...@gmail.com>.
Did anyone found the solution to this problem?
I'm facing the same issue for topic as well as certain queue consumers if
the activemq is restarted.
I keep getting session is closed error and the routes don't work properly
until I restart the application (karaf).
Please guide if you have found the solution for this.
Thanks,
Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/automatically-restarting-route-from-activemq-tp509859p5764639.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: automatically restarting route (from + activemq)?
Posted by Łukasz Budnik <lu...@gmail.com>.
Hi there,
I'm not using connection factory explicitly. I'm using
ActiveMQComponent which uses brokerURL property. I googled some more
and found out a solution. Maybe it can help others:
<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL"
value="failover:(tcp://127.0.0.1:61616)?maxReconnectAttempts=-1" />
</bean>
cheers,
Łukasz
On 17 June 2010 15:18, Adrian Trenaman <tr...@progress.com> wrote:
> Need to see the connection string for the activemq connection factory called
> 'remoteactivemq'!
>
> On 17/06/2010 13:10, Łukasz Budnik wrote:
>>
>> Sure thing:
>>
>> The route is very simple:
>>
>> <route>
>> <from
>>
>> uri="remoteactivemq:topic:remotetopic?clientId=UniqueIdHere&durableSubscriptionName=AscariCamelRoute&subscriptionDurable=true&cacheLevelName=CACHE_CONSUMER"
>> />
>> <to uri="file:target/messages/remotetopic" />
>> </route>
>>
>> remoteacrtivemq is a standalone ActiveMQ.
>>
>> thanks,
>> Łukasz
>>
>> On 17 June 2010 13:49, Adrian Trenaman<tr...@progress.com> wrote:
>>
>>>
>>> can you send me your connection string?
>>>
>>> On 17/06/2010 12:40, Łukasz Budnik wrote:
>>>
>>>>
>>>> Thanks Ade for a hint,
>>>>
>>>> I googled for reconnect string but found nothing. But I found
>>>> something similar. When you use topics you can create a durable
>>>> client. I did so:
>>>>
>>>> But after restarting ActiveMQ, my route didn't start consuming
>>>> messages from my topic. On the ActiveMQ admin console
>>>> http://localhost:8161/admin/subscribers.jsp page I saw that connection
>>>> ID is set to offline and new messages are all pending.
>>>>
>>>> Client ID Subscription Name Connection ID
>>>> Destination
>>>> Selector Pending Queue Size
>>>> UniqueIdHere AscariCamelRoute OFFLINE remotetopic
>>>> 43
>>>>
>>>> Has anyone experienced (and solved) this problem?
>>>>
>>>> thanks,
>>>> Łukasz
>>>>
>>>> On 17 June 2010 11:42, Adrian Trenaman<tr...@progress.com> wrote:
>>>>
>>>>
>>>>>
>>>>> You need to set your reconnection settings on the ActiveMQ connection
>>>>> string! AFAIR, Camel doesn't reconnect by default.
>>>>>
>>>>> Cheers,
>>>>> Ade.
>>>>>
>>>>> On 17/06/2010 09:51, Łukasz Budnik wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I'm new to Camel and I'm evaluating it.
>>>>>>
>>>>>> I have a simple scenario: I want to consume messages from a remote
>>>>>> Active
>>>>>> MQ:
>>>>>>
>>>>>> <route>
>>>>>> <from uri="remoteactivemq:queue:remotequeue" />
>>>>>> <to uri="file:target/messages/remotequeue" />
>>>>>> </route>
>>>>>>
>>>>>> Everything works fine until I kill Active MQ. Camel disconnects from
>>>>>> ActiveMQ. When the ActiveMQ is started again, new messages are not
>>>>>> being consumed. Route is a zombie, it is started but not active any
>>>>>> more.
>>>>>>
>>>>>> How to solve this problem?
>>>>>>
>>>>>> thanks,
>>>>>> Łukasz
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>
>>>
>
Re: automatically restarting route (from + activemq)?
Posted by Adrian Trenaman <tr...@progress.com>.
Need to see the connection string for the activemq connection factory
called 'remoteactivemq'!
On 17/06/2010 13:10, Łukasz Budnik wrote:
> Sure thing:
>
> The route is very simple:
>
> <route>
> <from
> uri="remoteactivemq:topic:remotetopic?clientId=UniqueIdHere&durableSubscriptionName=AscariCamelRoute&subscriptionDurable=true&cacheLevelName=CACHE_CONSUMER"
> />
> <to uri="file:target/messages/remotetopic" />
> </route>
>
> remoteacrtivemq is a standalone ActiveMQ.
>
> thanks,
> Łukasz
>
> On 17 June 2010 13:49, Adrian Trenaman<tr...@progress.com> wrote:
>
>> can you send me your connection string?
>>
>> On 17/06/2010 12:40, Łukasz Budnik wrote:
>>
>>> Thanks Ade for a hint,
>>>
>>> I googled for reconnect string but found nothing. But I found
>>> something similar. When you use topics you can create a durable
>>> client. I did so:
>>>
>>> But after restarting ActiveMQ, my route didn't start consuming
>>> messages from my topic. On the ActiveMQ admin console
>>> http://localhost:8161/admin/subscribers.jsp page I saw that connection
>>> ID is set to offline and new messages are all pending.
>>>
>>> Client ID Subscription Name Connection ID
>>> Destination
>>> Selector Pending Queue Size
>>> UniqueIdHere AscariCamelRoute OFFLINE remotetopic
>>> 43
>>>
>>> Has anyone experienced (and solved) this problem?
>>>
>>> thanks,
>>> Łukasz
>>>
>>> On 17 June 2010 11:42, Adrian Trenaman<tr...@progress.com> wrote:
>>>
>>>
>>>> You need to set your reconnection settings on the ActiveMQ connection
>>>> string! AFAIR, Camel doesn't reconnect by default.
>>>>
>>>> Cheers,
>>>> Ade.
>>>>
>>>> On 17/06/2010 09:51, Łukasz Budnik wrote:
>>>>
>>>>
>>>>> Hi all,
>>>>>
>>>>> I'm new to Camel and I'm evaluating it.
>>>>>
>>>>> I have a simple scenario: I want to consume messages from a remote
>>>>> Active
>>>>> MQ:
>>>>>
>>>>> <route>
>>>>> <from uri="remoteactivemq:queue:remotequeue" />
>>>>> <to uri="file:target/messages/remotequeue" />
>>>>> </route>
>>>>>
>>>>> Everything works fine until I kill Active MQ. Camel disconnects from
>>>>> ActiveMQ. When the ActiveMQ is started again, new messages are not
>>>>> being consumed. Route is a zombie, it is started but not active any
>>>>> more.
>>>>>
>>>>> How to solve this problem?
>>>>>
>>>>> thanks,
>>>>> Łukasz
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>
Re: automatically restarting route (from + activemq)?
Posted by Łukasz Budnik <lu...@gmail.com>.
Sure thing:
The route is very simple:
<route>
<from
uri="remoteactivemq:topic:remotetopic?clientId=UniqueIdHere&durableSubscriptionName=AscariCamelRoute&subscriptionDurable=true&cacheLevelName=CACHE_CONSUMER"
/>
<to uri="file:target/messages/remotetopic" />
</route>
remoteacrtivemq is a standalone ActiveMQ.
thanks,
Łukasz
On 17 June 2010 13:49, Adrian Trenaman <tr...@progress.com> wrote:
> can you send me your connection string?
>
> On 17/06/2010 12:40, Łukasz Budnik wrote:
>>
>> Thanks Ade for a hint,
>>
>> I googled for reconnect string but found nothing. But I found
>> something similar. When you use topics you can create a durable
>> client. I did so:
>>
>> But after restarting ActiveMQ, my route didn't start consuming
>> messages from my topic. On the ActiveMQ admin console
>> http://localhost:8161/admin/subscribers.jsp page I saw that connection
>> ID is set to offline and new messages are all pending.
>>
>> Client ID Subscription Name Connection ID
>> Destination
>> Selector Pending Queue Size
>> UniqueIdHere AscariCamelRoute OFFLINE remotetopic
>> 43
>>
>> Has anyone experienced (and solved) this problem?
>>
>> thanks,
>> Łukasz
>>
>> On 17 June 2010 11:42, Adrian Trenaman<tr...@progress.com> wrote:
>>
>>>
>>> You need to set your reconnection settings on the ActiveMQ connection
>>> string! AFAIR, Camel doesn't reconnect by default.
>>>
>>> Cheers,
>>> Ade.
>>>
>>> On 17/06/2010 09:51, Łukasz Budnik wrote:
>>>
>>>>
>>>> Hi all,
>>>>
>>>> I'm new to Camel and I'm evaluating it.
>>>>
>>>> I have a simple scenario: I want to consume messages from a remote
>>>> Active
>>>> MQ:
>>>>
>>>> <route>
>>>> <from uri="remoteactivemq:queue:remotequeue" />
>>>> <to uri="file:target/messages/remotequeue" />
>>>> </route>
>>>>
>>>> Everything works fine until I kill Active MQ. Camel disconnects from
>>>> ActiveMQ. When the ActiveMQ is started again, new messages are not
>>>> being consumed. Route is a zombie, it is started but not active any
>>>> more.
>>>>
>>>> How to solve this problem?
>>>>
>>>> thanks,
>>>> Łukasz
>>>>
>>>>
>>>
>>>
>
Re: automatically restarting route (from + activemq)?
Posted by Adrian Trenaman <tr...@progress.com>.
can you send me your connection string?
On 17/06/2010 12:40, Łukasz Budnik wrote:
> Thanks Ade for a hint,
>
> I googled for reconnect string but found nothing. But I found
> something similar. When you use topics you can create a durable
> client. I did so:
>
> But after restarting ActiveMQ, my route didn't start consuming
> messages from my topic. On the ActiveMQ admin console
> http://localhost:8161/admin/subscribers.jsp page I saw that connection
> ID is set to offline and new messages are all pending.
>
> Client ID Subscription Name Connection ID Destination
> Selector Pending Queue Size
> UniqueIdHere AscariCamelRoute OFFLINE remotetopic 43
>
> Has anyone experienced (and solved) this problem?
>
> thanks,
> Łukasz
>
> On 17 June 2010 11:42, Adrian Trenaman<tr...@progress.com> wrote:
>
>> You need to set your reconnection settings on the ActiveMQ connection
>> string! AFAIR, Camel doesn't reconnect by default.
>>
>> Cheers,
>> Ade.
>>
>> On 17/06/2010 09:51, Łukasz Budnik wrote:
>>
>>> Hi all,
>>>
>>> I'm new to Camel and I'm evaluating it.
>>>
>>> I have a simple scenario: I want to consume messages from a remote Active
>>> MQ:
>>>
>>> <route>
>>> <from uri="remoteactivemq:queue:remotequeue" />
>>> <to uri="file:target/messages/remotequeue" />
>>> </route>
>>>
>>> Everything works fine until I kill Active MQ. Camel disconnects from
>>> ActiveMQ. When the ActiveMQ is started again, new messages are not
>>> being consumed. Route is a zombie, it is started but not active any
>>> more.
>>>
>>> How to solve this problem?
>>>
>>> thanks,
>>> Łukasz
>>>
>>>
>>
Re: automatically restarting route (from + activemq)?
Posted by Łukasz Budnik <lu...@gmail.com>.
Thanks Ade for a hint,
I googled for reconnect string but found nothing. But I found
something similar. When you use topics you can create a durable
client. I did so:
But after restarting ActiveMQ, my route didn't start consuming
messages from my topic. On the ActiveMQ admin console
http://localhost:8161/admin/subscribers.jsp page I saw that connection
ID is set to offline and new messages are all pending.
Client ID Subscription Name Connection ID Destination
Selector Pending Queue Size
UniqueIdHere AscariCamelRoute OFFLINE remotetopic 43
Has anyone experienced (and solved) this problem?
thanks,
Łukasz
On 17 June 2010 11:42, Adrian Trenaman <tr...@progress.com> wrote:
> You need to set your reconnection settings on the ActiveMQ connection
> string! AFAIR, Camel doesn't reconnect by default.
>
> Cheers,
> Ade.
>
> On 17/06/2010 09:51, Łukasz Budnik wrote:
>>
>> Hi all,
>>
>> I'm new to Camel and I'm evaluating it.
>>
>> I have a simple scenario: I want to consume messages from a remote Active
>> MQ:
>>
>> <route>
>> <from uri="remoteactivemq:queue:remotequeue" />
>> <to uri="file:target/messages/remotequeue" />
>> </route>
>>
>> Everything works fine until I kill Active MQ. Camel disconnects from
>> ActiveMQ. When the ActiveMQ is started again, new messages are not
>> being consumed. Route is a zombie, it is started but not active any
>> more.
>>
>> How to solve this problem?
>>
>> thanks,
>> Łukasz
>>
>
Re: automatically restarting route (from + activemq)?
Posted by Adrian Trenaman <tr...@progress.com>.
You need to set your reconnection settings on the ActiveMQ connection
string! AFAIR, Camel doesn't reconnect by default.
Cheers,
Ade.
On 17/06/2010 09:51, Łukasz Budnik wrote:
> Hi all,
>
> I'm new to Camel and I'm evaluating it.
>
> I have a simple scenario: I want to consume messages from a remote Active MQ:
>
> <route>
> <from uri="remoteactivemq:queue:remotequeue" />
> <to uri="file:target/messages/remotequeue" />
> </route>
>
> Everything works fine until I kill Active MQ. Camel disconnects from
> ActiveMQ. When the ActiveMQ is started again, new messages are not
> being consumed. Route is a zombie, it is started but not active any
> more.
>
> How to solve this problem?
>
> thanks,
> Łukasz
>