You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by huntc <hu...@mac.com> on 2009/01/17 05:09:20 UTC

Unexpected ActiveMQ FailoverTransport messages in my log

Hi there,

I am getting many messages of the form:

[ActiveMQ Task  ] INFO  FailoverTransport              - Successfully
connected to tcp://localhost:61616

...in my log file. My expectation is that these should only appear
periodically. However I'm seeing them a great deal.

My broker URL is defined as:

failover:tcp://localhost:61616

(failover is used to avoid a reconnect bug that I have previously reported).

I appear to get the message every time that I publish to an
activemq:queue:xxx endpoint and receive (in the same process) on
activemq:queue:xxx?concurrentConsumers=2

Any ideas on what is happening here? The message implies that a connection
with the broker is being made each time that I produce on the queue. Is that
normal behaviour?

btw: I have tried using the randomize option as per
http://activemq.apache.org/failover-transport-reference.html but to no
avail.


Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Unexpected-ActiveMQ-FailoverTransport-messages-in-my-log-tp21512906s22882p21512906.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unexpected ActiveMQ FailoverTransport messages in my log

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for letting us know.
Do you have wiki rights to edit? If so then please go ahead and add
some text about your findings and a link to that page.

Its great when the community itself can update Camel documentation.


On Mon, Jan 19, 2009 at 7:18 AM, huntc <hu...@mac.com> wrote:
>
> OK - now I remember.. you have to use a pooled connection factory when
> producing to a queue as per:
>
> http://activemq.apache.org/jmstemplate-gotchas.html
>
> The crazy thing is that I knew that, but I had just forgotten.
>
> Given that my Camel application both produces and consumes on queues I have
> now created two connection components:
>
>
>  &lt;!-- Set up ActiveMQ --&gt;
>  &lt;bean id="activemq-receiver"
> class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
>    &lt;property name="connectionFactory"&gt;
>      &lt;bean class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
>        &lt;property name="brokerURL"
>          value="${mybrokerurl}" /&gt;
>      &lt;/bean&gt;
>    &lt;/property&gt;
>  &lt;/bean&gt;
>  &lt;bean id="activemq-sender"
> class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
>    &lt;property name="connectionFactory"&gt;
>      &lt;bean class="org.apache.activemq.pool.PooledConnectionFactory"&gt;
>        &lt;constructor-arg value="${mybrokerurl}" /&gt;
>      &lt;/bean&gt;
>    &lt;/property&gt;
>  &lt;/bean&gt;
>
>
> I hope that this thread is a useful reminder for what would probably be a
> common trap. Would this be worth being included on the ActiveMQ component
> page?
>
> http://activemq.apache.org/camel/activemq.html
>
> Kind regards,
> Christopher
> --
> View this message in context: http://www.nabble.com/Unexpected-ActiveMQ-FailoverTransport-messages-in-my-log-tp21512906s22882p21537495.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: Unexpected ActiveMQ FailoverTransport messages in my log

Posted by huntc <hu...@mac.com>.
OK - now I remember.. you have to use a pooled connection factory when
producing to a queue as per:

http://activemq.apache.org/jmstemplate-gotchas.html

The crazy thing is that I knew that, but I had just forgotten.

Given that my Camel application both produces and consumes on queues I have
now created two connection components:


  &lt;!-- Set up ActiveMQ --&gt;
  &lt;bean id="activemq-receiver"
class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
    &lt;property name="connectionFactory"&gt;
      &lt;bean class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
        &lt;property name="brokerURL"
          value="${mybrokerurl}" /&gt;
      &lt;/bean&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="activemq-sender"
class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
    &lt;property name="connectionFactory"&gt;
      &lt;bean class="org.apache.activemq.pool.PooledConnectionFactory"&gt;
        &lt;constructor-arg value="${mybrokerurl}" /&gt;
      &lt;/bean&gt;
    &lt;/property&gt;
  &lt;/bean&gt;


I hope that this thread is a useful reminder for what would probably be a
common trap. Would this be worth being included on the ActiveMQ component
page?

http://activemq.apache.org/camel/activemq.html

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Unexpected-ActiveMQ-FailoverTransport-messages-in-my-log-tp21512906s22882p21537495.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unexpected ActiveMQ FailoverTransport messages in my log

Posted by huntc <hu...@mac.com>.
I've been battling with this one for a couple of days now... I'm asking a
question in the ActiveMQ forum about the connection time and why it takes so
long. However I still don't get why my application connects to the broker
each time it wants to produce a message on the queue... I am using a
connection factory as indicated earlier...

Thanks for your help. Eagerly waiting upon your collective pearls of wisdom.
:confused:

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Unexpected-ActiveMQ-FailoverTransport-messages-in-my-log-tp21512906s22882p21537172.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unexpected ActiveMQ FailoverTransport messages in my log

Posted by huntc <hu...@mac.com>.
My last message tonight - I promise!


I have been looking into this a bit further and now understand that a
failover will connect each time. That said, a connection to a broker running
on the same machine should only take a couple of milliseconds. Indeed on my
Macbook Air here is the sequence of events:


2009-01-17 22:26:40,804 [mousIoService-6] DEBUG MinaConsumer                  
- Received body:
au.com.blueglue.bluegluedevices.readersocketprotocol.HeartbeatNotification@233b8d
2009-01-17 22:26:40,804 [mousIoService-6] DEBUG DefaultTypeConverter          
- Converting null -&gt; java.lang.String with value: null
2009-01-17 22:26:40,806 [mousIoService-6] DEBUG WireFormatNegotiator          
- Sending: WireFormatInfo { version=3,
properties={TightEncodingEnabled=true, CacheSize=1024,
TcpNoDelayEnabled=true, SizePrefixDisabled=false, StackTraceEnabled=true,
MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000,
CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}


However on my Linux machine the above sequence takes over 100ms and goes
like this:


2009-01-17 21:56:56,572 [mousIoService-4] DEBUG MinaConsumer                  
- Received body:
au.com.blueglue.bluegluedevices.readersocketprotocol.HeartbeatNotification@2728ed5f
2009-01-17 21:56:56,572 [mousIoService-4] DEBUG DefaultTypeConverter          
- Converting null -&gt; java.lang.String with value: null
2009-01-17 21:56:56,572 [mousIoService-4] DEBUG FailoverTransport             
- Waking up reconnect task
2009-01-17 21:56:56,573 [mousIoService-4] DEBUG FailoverTransport             
- Started.
2009-01-17 21:56:56,573 [mousIoService-4] DEBUG FailoverTransport             
- Waking up reconnect task
2009-01-17 21:56:56,573 [mousIoService-4] DEBUG FailoverTransport             
- Waiting for transport to reconnect.
2009-01-17 21:56:56,573 [ActiveMQ Task  ] DEBUG FailoverTransport             
- Attempting connect to: tcp://127.0.0.1:61616
2009-01-17 21:56:56,618 [nerContainer-62] DEBUG
efaultMessageListenerContainer - Consumer [ActiveMQMessageConsumer {
value=ID:&lt;&lt;some domain&gt;-50284-1232189785356-0:0:1:1, started=true
}] of session [ActiveMQSession {id=ID:&lt;some
domain&gt;-50284-1232189785356-0:0:1,started=true}] did not receive a
message
2009-01-17 21:56:56,618 [nerContainer-61] DEBUG
efaultMessageListenerContainer - Consumer [ActiveMQMessageConsumer {
value=ID:&lt;some domain&gt;-50284-1232189785356-0:0:2:1, started=true }] of
session [ActiveMQSession {id=ID:&lt;some
domain&gt;-50284-1232189785356-0:0:2,started=true}] did not receive a
message
2009-01-17 21:56:56,695 [ActiveMQ Task  ] DEBUG WireFormatNegotiator          
- Sending: WireFormatInfo { version=3, properties={CacheSize=1024,
CacheEnabled=true, SizePrefixDisabled=false,
MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true,
MaxInactivityDuration=30000, TightEncodingEnabled=true,
StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}


Why is it taking so much longer to connect to the broker on my Linux
machine? The Linux machine is much more powerful than this laptop.


Thanks for any advice.


Kind regards,

Christopher

-- 
View this message in context: http://www.nabble.com/Unexpected-ActiveMQ-FailoverTransport-messages-in-my-log-tp21512906s22882p21515595.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unexpected ActiveMQ FailoverTransport messages in my log

Posted by huntc <hu...@mac.com>.
I should just add that I'm using a connection factory ala:

	<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="connectionFactory">
			<bean class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL"
					value="failover:(tcp://localhost:61616)?randomize=false" />
			</bean>
		</property>
	</bean>


-- 
View this message in context: http://www.nabble.com/Unexpected-ActiveMQ-FailoverTransport-messages-in-my-log-tp21512906s22882p21514442.html
Sent from the Camel - Users mailing list archive at Nabble.com.