d-man
d-man

Reputation: 58103

Spring Jms warn message every second

Java - Spring - JMS

I am using Spring with JMS listener and the following is my code snippet.

report.broker.url=failover:(tcp://w-dlapp00:5061?daemon=true;tcp://w-dlapp01:5061?daemon=true)?randomize=false&timeout=3000

spring context, I found the problem is it's giving warning because queue w-dlapp00:5061 is down but due to it being in failover the other queue is working - how can I get rid of this warning?

<!-- Active MQ changes -->
  <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL">
      <value>${royality.report.broker.url}</value>
    </property>
  </bean>

  <bean id="destinationRoyaltyReport" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg value="${royality.report.queue}"/>
  </bean>

  <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="defaultDestination" ref="destinationRoyaltyReport"/>
  </bean>

  <jms:listener-container connection-factory="connectionFactory">
    <jms:listener destination="${royality.report.markingrid.queue}" ref="royaltyReportListener" method="onReceivedRoyaltyReportGridRequest"/>
    <jms:listener destination="${royality.report.queue}" ref="royaltyReportListener" method="onReceivedRoyaltyReportViewRequest"/>
  </jms:listener-container>
  <!-- Active MQ changes -->

When i look at the log file it is full with JMS info and WARN statements as following, could not figure out what is going on. There is warn message seems some thing is crashing ?

2013-02-20 14:34:28,691 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] WARN  [DefaultMessageListenerContainer.java:834] : id[] Setup of JMS message listener invoker failed for destination 'royaltyReportMarkInGridQueue' - trying to recover. Cause: Failover timeout of 3000 ms reached.
2013-02-20 14:34:31,763 [org.springframework.jms.listener.DefaultMessageListenerContainer#1-1] WARN  [DefaultMessageListenerContainer.java:834] : id[] Setup of JMS message listener invoker failed for destination 'royaltyReportQueue' - trying to recover. Cause: Failover timeout of 3000 ms reached.
2013-02-20 14:34:31,767 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] INFO  [FailoverTransport.java:507] : id[] Failover timed out after 3073ms
2013-02-20 14:34:31,768 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] WARN  [DefaultMessageListenerContainer.java:888] : id[] Could not refresh JMS Connection for destination 'royaltyReportMarkInGridQueue' - retrying in 5000 ms. Cause: Failover timeout of 3000 ms reached.
2013-02-20 14:34:34,838 [org.springframework.jms.listener.DefaultMessageListenerContainer#1-1] INFO  [FailoverTransport.java:507] : id[] Failover timed out after 3073ms
2013-02-20 14:34:34,838 [org.springframework.jms.listener.DefaultMessageListenerContainer#1-1] WARN  [DefaultMessageListenerContainer.java:888] : id[] Could not refresh JMS Connection for destination 'royaltyReportQueue' - retrying in 5000 ms. Cause: Failover timeout of 3000 ms reached.
2013-02-20 14:34:39,839 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] INFO  [FailoverTransport.java:507] : id[] Failover timed out after 3065ms
2013-02-20 14:34:39,841 [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] WARN  [DefaultMessageListenerContainer.java:888] : id[] Could not refresh JMS Connection for destination 'royaltyReportMarkInGridQueue' - retrying in 5000 ms. Cause: Failover timeout of 3000 ms reached.
2013-02-20 14:34:42,910 [org.springframework.jms.listener.DefaultMessageListenerContainer#1-1] INFO  [FailoverTransport.java:507] : id[] Failover timed out after 3068ms
2013-02-20 14:34:42,910 [org.springframework.jms.listener.DefaultMessageListenerContainer#1-1] WARN  [DefaultMessageListenerContainer.java:888] : id[] Could not refresh JMS Connection for destination 'royaltyReportQueue' - retrying in 5000 ms. Cause: Failover timeout of 3000 ms reached.

Upvotes: 2

Views: 12181

Answers (3)

d-man
d-man

Reputation: 58103

instead of using ; between two brokers i used ',' and seems to be working

look at here for details

Upvotes: 0

Michael A
Michael A

Reputation: 5850

The logging of the ActiveMQ is controled by the Log4J "log4j.properties" file.

You can define the level of messages you want the loger to show(warn, error etc), and where the logs should be printed (Console, log_file etc).

In your case you can disable the WARN logs for your log file and print them else where.

I personnaly would like to see where my message was sent and if the failover failed to send to one of the hosts id prefer knowing about it.

Upvotes: 0

Gary Russell
Gary Russell

Reputation: 174769

It simply means it can't connect to either of the servers in the failover transport. Notice you have timeout=3000 which causes the transport to throw the exception. The container keeps retrying.

Upvotes: 1

Related Questions