7

While subscribing message using DefaultJmsListenerContainerFactory in spring and camel using failover activemq transport I am continuously getting below INFO messages.

2016-08-25 15:00:07,235 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:08,265 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:08,265 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:09,296 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:09,328 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:10,299 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:10,346 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:11,318 [ActiveMQ Task-1] INFO  transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616

Is this possible to disable this INFO message on console or is there any time interval for printing this message on console?

I have tried to use some ActiveMQ transport connection option but it didn't help me.

Vladislav Kysliy
  • 3,488
  • 3
  • 32
  • 44
bvyas
  • 384
  • 3
  • 10

3 Answers3

3

The first thing which comes to my mind that you could play around with the failover parameters like documented here: http://activemq.apache.org/failover-transport-reference.html

gtonic
  • 2,295
  • 1
  • 24
  • 32
  • 2
    :Thanks for the reply. I figure it out in a way where I am disabling Info at log4j level of activemq like this : logging.level.org.apache.activemq=WARN – bvyas Oct 07 '16 at 14:14
0

We found that the connection pool is disabled by default when using SpringBoot and ActiveMQ. We set the following property in our application.yml file to enable the pool:

spring.activemq.pool.enabled: true

Setting the log level to WARN just masks the problem, as it will still be discarding and recreating the connections behind the scenes.

dave.c
  • 10,910
  • 5
  • 39
  • 62
  • We have `spring.activemq.pool.enabled=true` in our props, but we keep getting those messages with `broker-url` set to `failover://(tcp://...,tcp://...)?randomize=false&initialReconnectDelay=5000&maxReconnectAttempts=4&timeout=3000&maxReconnectDelay=30000&jms.prefetchPolicy.all=10`. So it's probably somewhere in those parameters. I agree that just pushing the log level is not real solution. – virgo47 Mar 11 '19 at 07:56
0

From the ActiveMQ Forum:

The default idleTimeout of the PooledConnectionFactory is only 30 seconds. And physical connections are borrowed in a round-robin fashion. So if it takes the application more than 30 seconds to cycle through the 5 connections, you'll start observing connection churn, which seems exactly what's happening in your case. Is it possible that 30 secs elapsed between subsequent uses of the JmsTemplate in your scenario?

So the solution should be to update the connection pool's idleTimeout.

max
  • 1,134
  • 10
  • 16