You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Schneider <cs...@talend.com> on 2011/01/26 15:03:47 UTC

Camel "hangs" on ActiveMQ connect

I just found an interesting "problem" with Camel and ActiveMQ.

I defined my connection factory for jms like below without an explicit url:
   <bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory">
   </bean>

I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.

When I started the spring context the last line in the log showed that the consumer for the annotation started. The problem was that no other route came up and even
the spring initialization did not return.

It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.

I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.

Any opinions?

Christian


Re: Camel "hangs" on ActiveMQ connect

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hmm... That is not nice. But is this not something that should be caught in
the ActiveMQ project. Not sure if there is anything more that Camel could do
here other than what Claus said i.e fail quickly or look for a connect
exception.

Yikes... Never looked into that or tested for that before...

- Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-hangs-on-ActiveMQ-connect-tp3357917p3358044.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel "hangs" on ActiveMQ connect

Posted by Claus Ibsen <cl...@gmail.com>.
I have found an improvement and created a ticket
https://issues.apache.org/jira/browse/CAMEL-3598

On Wed, Jan 26, 2011 at 5:40 PM, Christian Schneider
<cs...@talend.com> wrote:
> I think the options to not have this effect are there in any case. The problem is that the default is causing the hang.
> Probably this can best be solved by the ActiveMQ team. Some warning that no server could be reached would have saved me.
> I will ask on the ActiveMQ list about that problem.
>
> Christian
>
>
> -----Ursprüngliche Nachricht-----
> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Gesendet: Mittwoch, 26. Januar 2011 17:04
> An: users@camel.apache.org
> Betreff: Re: Camel "hangs" on ActiveMQ connect
>
> On Wed, Jan 26, 2011 at 4:52 PM, Christian Schneider <cs...@talend.com> wrote:
>> Hi Claus,
>>
>> I know that at least Tibco EMS does the same like ActiveMQ when using failover transport. This is why we did not use failover for test setups so we could diagnose problems with the jms server (e.g. wrong URL) easier.
>>
>> The option did not work. I think it can not really work. As far as I understand it simply means that camel tries to connect a the start. The problem is that exactly this try to connect makes camel "hang". I think that endpoints that listen on jms are always started anyway.
>>
>
> Ah AMQ has some options to control timeout on initial connection you can set.
> I think its startupMaxReconnectAttempts
> http://activemq.apache.org/failover-transport-reference.html
>
> We added that option to AMQ and the option to Camel based on req from a fuse customer.
>
>
>> Christian
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Gesendet: Mittwoch, 26. Januar 2011 16:17
>> An: users@camel.apache.org
>> Betreff: Re: Camel "hangs" on ActiveMQ connect
>>
>> On Wed, Jan 26, 2011 at 4:06 PM, Christian Schneider <cs...@talend.com> wrote:
>>> That´s a good thing. What do you think ? Should we somewhere document a warning about the problem on the wiki page of the jms component?
>>>
>>
>> Christian did you try it?
>>
>> Yeah we could add a TIP to the camel-jms wiki page to highlight this option.
>>
>> Mind that the automatic failover thingy is an AMQ specific. Another broker may fail ASAP.
>>
>>
>>> Christian
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>>> Gesendet: Mittwoch, 26. Januar 2011 15:07
>>> An: users@camel.apache.org
>>> Betreff: Re: Camel "hangs" on ActiveMQ connect
>>>
>>> Try setting testConnectionOnStartup=true on the jms endpoint. Then it ought to fail fast.
>>>
>>>
>>>
>>> On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider <cs...@talend.com> wrote:
>>>> I just found an interesting "problem" with Camel and ActiveMQ.
>>>>
>>>> I defined my connection factory for jms like below without an explicit url:
>>>>   <bean id="connectionFactory"
>>>> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>>>>   </bean>
>>>>
>>>> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>>>>
>>>> When I started the spring context the last line in the log showed
>>>> that the consumer for the annotation started. The problem was that no other route came up and even the spring initialization did not return.
>>>>
>>>> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>>>>
>>>> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>>>>
>>>> Any opinions?
>>>>
>>>> Christian
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> FuseSource
>>> Email: cibsen@fusesource.com
>>> Web: http://fusesource.com
>>> Twitter: davsclaus
>>> Blog: http://davsclaus.blogspot.com/
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

AW: Camel "hangs" on ActiveMQ connect

Posted by Christian Schneider <cs...@talend.com>.
I think the options to not have this effect are there in any case. The problem is that the default is causing the hang.
Probably this can best be solved by the ActiveMQ team. Some warning that no server could be reached would have saved me.
I will ask on the ActiveMQ list about that problem.

Christian


-----Ursprüngliche Nachricht-----
Von: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Gesendet: Mittwoch, 26. Januar 2011 17:04
An: users@camel.apache.org
Betreff: Re: Camel "hangs" on ActiveMQ connect

On Wed, Jan 26, 2011 at 4:52 PM, Christian Schneider <cs...@talend.com> wrote:
> Hi Claus,
>
> I know that at least Tibco EMS does the same like ActiveMQ when using failover transport. This is why we did not use failover for test setups so we could diagnose problems with the jms server (e.g. wrong URL) easier.
>
> The option did not work. I think it can not really work. As far as I understand it simply means that camel tries to connect a the start. The problem is that exactly this try to connect makes camel "hang". I think that endpoints that listen on jms are always started anyway.
>

Ah AMQ has some options to control timeout on initial connection you can set.
I think its startupMaxReconnectAttempts
http://activemq.apache.org/failover-transport-reference.html

We added that option to AMQ and the option to Camel based on req from a fuse customer.


> Christian
>
>
> -----Ursprüngliche Nachricht-----
> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Gesendet: Mittwoch, 26. Januar 2011 16:17
> An: users@camel.apache.org
> Betreff: Re: Camel "hangs" on ActiveMQ connect
>
> On Wed, Jan 26, 2011 at 4:06 PM, Christian Schneider <cs...@talend.com> wrote:
>> That´s a good thing. What do you think ? Should we somewhere document a warning about the problem on the wiki page of the jms component?
>>
>
> Christian did you try it?
>
> Yeah we could add a TIP to the camel-jms wiki page to highlight this option.
>
> Mind that the automatic failover thingy is an AMQ specific. Another broker may fail ASAP.
>
>
>> Christian
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Gesendet: Mittwoch, 26. Januar 2011 15:07
>> An: users@camel.apache.org
>> Betreff: Re: Camel "hangs" on ActiveMQ connect
>>
>> Try setting testConnectionOnStartup=true on the jms endpoint. Then it ought to fail fast.
>>
>>
>>
>> On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider <cs...@talend.com> wrote:
>>> I just found an interesting "problem" with Camel and ActiveMQ.
>>>
>>> I defined my connection factory for jms like below without an explicit url:
>>>   <bean id="connectionFactory"
>>> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>>>   </bean>
>>>
>>> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>>>
>>> When I started the spring context the last line in the log showed 
>>> that the consumer for the annotation started. The problem was that no other route came up and even the spring initialization did not return.
>>>
>>> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>>>
>>> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>>>
>>> Any opinions?
>>>
>>> Christian
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel "hangs" on ActiveMQ connect

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jan 26, 2011 at 4:52 PM, Christian Schneider
<cs...@talend.com> wrote:
> Hi Claus,
>
> I know that at least Tibco EMS does the same like ActiveMQ when using failover transport. This is why we did not use failover for test setups so we could diagnose problems with the jms server (e.g. wrong URL) easier.
>
> The option did not work. I think it can not really work. As far as I understand it simply means that camel tries to connect a the start. The problem is that exactly this try to connect makes camel "hang". I think that endpoints that listen on jms are always started anyway.
>

Ah AMQ has some options to control timeout on initial connection you can set.
I think its startupMaxReconnectAttempts
http://activemq.apache.org/failover-transport-reference.html

We added that option to AMQ and the option to Camel based on req from
a fuse customer.


> Christian
>
>
> -----Ursprüngliche Nachricht-----
> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Gesendet: Mittwoch, 26. Januar 2011 16:17
> An: users@camel.apache.org
> Betreff: Re: Camel "hangs" on ActiveMQ connect
>
> On Wed, Jan 26, 2011 at 4:06 PM, Christian Schneider <cs...@talend.com> wrote:
>> That´s a good thing. What do you think ? Should we somewhere document a warning about the problem on the wiki page of the jms component?
>>
>
> Christian did you try it?
>
> Yeah we could add a TIP to the camel-jms wiki page to highlight this option.
>
> Mind that the automatic failover thingy is an AMQ specific. Another broker may fail ASAP.
>
>
>> Christian
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Gesendet: Mittwoch, 26. Januar 2011 15:07
>> An: users@camel.apache.org
>> Betreff: Re: Camel "hangs" on ActiveMQ connect
>>
>> Try setting testConnectionOnStartup=true on the jms endpoint. Then it ought to fail fast.
>>
>>
>>
>> On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider <cs...@talend.com> wrote:
>>> I just found an interesting "problem" with Camel and ActiveMQ.
>>>
>>> I defined my connection factory for jms like below without an explicit url:
>>>   <bean id="connectionFactory"
>>> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>>>   </bean>
>>>
>>> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>>>
>>> When I started the spring context the last line in the log showed
>>> that the consumer for the annotation started. The problem was that no other route came up and even the spring initialization did not return.
>>>
>>> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>>>
>>> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>>>
>>> Any opinions?
>>>
>>> Christian
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

AW: Camel "hangs" on ActiveMQ connect

Posted by Christian Schneider <cs...@talend.com>.
Hi Claus,

I know that at least Tibco EMS does the same like ActiveMQ when using failover transport. This is why we did not use failover for test setups so we could diagnose problems with the jms server (e.g. wrong URL) easier.

The option did not work. I think it can not really work. As far as I understand it simply means that camel tries to connect a the start. The problem is that exactly this try to connect makes camel "hang". I think that endpoints that listen on jms are always started anyway.

Christian


-----Ursprüngliche Nachricht-----
Von: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Gesendet: Mittwoch, 26. Januar 2011 16:17
An: users@camel.apache.org
Betreff: Re: Camel "hangs" on ActiveMQ connect

On Wed, Jan 26, 2011 at 4:06 PM, Christian Schneider <cs...@talend.com> wrote:
> That´s a good thing. What do you think ? Should we somewhere document a warning about the problem on the wiki page of the jms component?
>

Christian did you try it?

Yeah we could add a TIP to the camel-jms wiki page to highlight this option.

Mind that the automatic failover thingy is an AMQ specific. Another broker may fail ASAP.


> Christian
>
>
> -----Ursprüngliche Nachricht-----
> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Gesendet: Mittwoch, 26. Januar 2011 15:07
> An: users@camel.apache.org
> Betreff: Re: Camel "hangs" on ActiveMQ connect
>
> Try setting testConnectionOnStartup=true on the jms endpoint. Then it ought to fail fast.
>
>
>
> On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider <cs...@talend.com> wrote:
>> I just found an interesting "problem" with Camel and ActiveMQ.
>>
>> I defined my connection factory for jms like below without an explicit url:
>>   <bean id="connectionFactory"
>> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>>   </bean>
>>
>> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>>
>> When I started the spring context the last line in the log showed 
>> that the consumer for the annotation started. The problem was that no other route came up and even the spring initialization did not return.
>>
>> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>>
>> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>>
>> Any opinions?
>>
>> Christian
>>
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel "hangs" on ActiveMQ connect

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jan 26, 2011 at 4:06 PM, Christian Schneider
<cs...@talend.com> wrote:
> That´s a good thing. What do you think ? Should we somewhere document a warning about the problem on the wiki page of the jms component?
>

Christian did you try it?

Yeah we could add a TIP to the camel-jms wiki page to highlight this option.

Mind that the automatic failover thingy is an AMQ specific. Another
broker may fail ASAP.


> Christian
>
>
> -----Ursprüngliche Nachricht-----
> Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Gesendet: Mittwoch, 26. Januar 2011 15:07
> An: users@camel.apache.org
> Betreff: Re: Camel "hangs" on ActiveMQ connect
>
> Try setting testConnectionOnStartup=true on the jms endpoint. Then it ought to fail fast.
>
>
>
> On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider <cs...@talend.com> wrote:
>> I just found an interesting "problem" with Camel and ActiveMQ.
>>
>> I defined my connection factory for jms like below without an explicit url:
>>   <bean id="connectionFactory"
>> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>>   </bean>
>>
>> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>>
>> When I started the spring context the last line in the log showed that
>> the consumer for the annotation started. The problem was that no other route came up and even the spring initialization did not return.
>>
>> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>>
>> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>>
>> Any opinions?
>>
>> Christian
>>
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

AW: Camel "hangs" on ActiveMQ connect

Posted by Christian Schneider <cs...@talend.com>.
That´s a good thing. What do you think ? Should we somewhere document a warning about the problem on the wiki page of the jms component?

Christian


-----Ursprüngliche Nachricht-----
Von: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Gesendet: Mittwoch, 26. Januar 2011 15:07
An: users@camel.apache.org
Betreff: Re: Camel "hangs" on ActiveMQ connect

Try setting testConnectionOnStartup=true on the jms endpoint. Then it ought to fail fast.



On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider <cs...@talend.com> wrote:
> I just found an interesting "problem" with Camel and ActiveMQ.
>
> I defined my connection factory for jms like below without an explicit url:
>   <bean id="connectionFactory" 
> class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>   </bean>
>
> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>
> When I started the spring context the last line in the log showed that 
> the consumer for the annotation started. The problem was that no other route came up and even the spring initialization did not return.
>
> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>
> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>
> Any opinions?
>
> Christian
>
>



--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel "hangs" on ActiveMQ connect

Posted by Claus Ibsen <cl...@gmail.com>.
Try setting testConnectionOnStartup=true on the jms endpoint. Then it
ought to fail fast.



On Wed, Jan 26, 2011 at 3:03 PM, Christian Schneider
<cs...@talend.com> wrote:
> I just found an interesting "problem" with Camel and ActiveMQ.
>
> I defined my connection factory for jms like below without an explicit url:
>   <bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory">
>   </bean>
>
> I had a @Consume("jms:test") annotion in a class somewhere. I had no ActiveMQ server running.
>
> When I started the spring context the last line in the log showed that the consumer for the annotation started. The problem was that no other route came up and even
> the spring initialization did not return.
>
> It took me a while till I found that the startup of camel hung on the jms connect. I found that ActiveMQ uses that failover transport when no borker url is given. This transport style does not throw an exception when no server is present.
>
> I don´t know if we should do anything about this but it was extremly frustrating till I found the reason.
>
> Any opinions?
>
> Christian
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/