Announcement Announcement Module
Collapse
No announcement yet.
Unexpected behaviour with Rabbit Admin. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unexpected behaviour with Rabbit Admin.

    Hallo,

    I was under the impression that RabbitAdmin

    "by default automatically looks for beans of type Queue, Exchange and Binding and declares them to the broker on behalf of the user"

    It seems to me that if I have multiple queues already declared on the broker, if I add a new queue which is not declared, the admin will have problems declaring it, throwing :-

    Code:
    Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'TranslationQueue.local' in vhost '/', class-id=50, method-id=10), null, ""}

    RabbitMQ xml config :

    Code:
    <bean id="rcf" class="com.rabbitmq.client.ConnectionFactory">
        	<property name="host" value="${rabbitmq.host:localhost}"/>
        	<property name="requestedHeartbeat" value="10" />
    </bean>
    
    <rabbit:connection-factory id="connectionFactory" host="${rabbitmq.host:localhost}" port="${rabbitmq.port:5672}"
    		username="guest" password="guest" connection-factory="rcf" />
    
    <rabbit:admin connection-factory="connectionFactory" />
    
    <rabbit:queue name="TranslationQueue.${server.name:unknown}" >
    		<rabbit:queue-arguments value-type="java.lang.Long">
    		 	 	<entry key="x-message-ttl" value="2400000" />
    		</rabbit:queue-arguments>
    </rabbit:queue>
    Is it a known issue or some kind of configuration error ?

  • #2
    Please provide the full stack trace, together with the log (DEBUG). What version of spring-rabbit are you using?

    Comment


    • #3
      Code:
      java.io.IOException: null
      	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:755) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:61) ~[amqp-client-2.8.4.jar:na]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_25]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_25]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_25]
      	at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_25]
      	at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:348) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at $Proxy108.queueDeclarePassive(Unknown Source) ~[na:na]
      	at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:213) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:524) [spring-rabbit-1.1.3.RELEASE.jar:na]
      	at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25]
      Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'TranslationQueue.local' in vhost '/', class-id=50, method-id=10), null, ""}
      	at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:216) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118) ~[amqp-client-2.8.4.jar:na]
      	... 11 common frames omitted
      com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'TranslationQueue.local' in vhost '/', class-id=50, method-id=10), null, ""}
      	at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:454) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:294) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:144) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:91) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:526) ~[amqp-client-2.8.4.jar:na]
      15:44:07.067 [SimpleAsyncTaskExecutor-1] DEBUG o.s.a.r.l.BlockingQueueConsumer - Retrieving delivery for Consumer: tag=[amq.ctag-gG2J_FWmWJmTTjSW-TwiqU], channel=Cached Rabbit Channel: AMQChannel(amqp://[email protected]:5672/,1), acknowledgeMode=AUTO local queue size=0
      ...
      AMQChannel(amqp://[email protected]:5672/,1), acknowledgeMode=AUTO local queue size=0
      15:44:11.888 [SimpleAsyncTaskExecutor-1] WARN  o.s.a.r.l.SimpleMessageListenerContainer - Consumer raised exception, processing can restart if the connection factory supports it
      org.springframework.amqp.AmqpIOException: java.io.IOException
      	at org.springframework.amqp.rabbit.connection.RabbitUtils.convertRabbitAccessException(RabbitUtils.java:112) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.connection.RabbitAccessor.convertRabbitAccessException(RabbitAccessor.java:106) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:605) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.core.RabbitAdmin.initialize(RabbitAdmin.java:309) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.core.RabbitAdmin$10.onCreate(RabbitAdmin.java:243) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.connection.CompositeConnectionListener.onCreate(CompositeConnectionListener.java:31) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:230) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$1.createConnection(ConnectionFactoryUtils.java:119) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:163) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:109) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:199) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:524) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25]
      Caused by: java.io.IOException: null
      	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:733) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:61) ~[amqp-client-2.8.4.jar:na]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_25]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_25]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_25]
      	at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_25]
      	at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:348) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at $Proxy108.queueDeclare(Unknown Source) ~[na:na]
      	at org.springframework.amqp.rabbit.core.RabbitAdmin.declareQueues(RabbitAdmin.java:342) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.core.RabbitAdmin.access$200(RabbitAdmin.java:46) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.core.RabbitAdmin$11.doInRabbit(RabbitAdmin.java:312) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:600) ~[spring-rabbit-1.1.3.RELEASE.jar:na]
      	... 10 common frames omitted
      Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-message-ttl'for queue 'MatchStateQueue.local' in vhost '/': received the value '2400000' of type 'long' but current is the value '100000' of type 'long', class-id=50, method-id=10), null, ""}
      	at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:216) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118) ~[amqp-client-2.8.4.jar:na]
      	... 22 common frames omitted
      com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-message-ttl'for queue 'MatchStateQueue.local' in vhost '/': received the value '2400000' of type 'long' but current is the value '100000' of type 'long', class-id=50, method-id=10), null, ""}
      	at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:454) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:294) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:144) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:91) ~[amqp-client-2.8.4.jar:na]
      	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:526) ~[amqp-client-2.8.4.jar:na]
      15:44:11.889 [SimpleAsyncTaskExecutor-1] INFO  o.s.a.r.l.SimpleMessageListenerContainer - Restarting Consumer: tag=[null], channel=null, acknowledgeMode=AUTO local queue size=0
      ...
      ...
      ...
      ...

      Comment


      • #4
        So. Thanks for the pointer on the debug level. Turns out it was having trouble when the ttl of the messages was mismatched between the broker and the config for a DIFFERENT queue. However, this wasn't clear from the initial exception. Only under debug logging.

        The version was 1.1.3.RELEASE
        Last edited by patelm5; Jan 30th, 2013, 11:14 AM.

        Comment


        • #5
          Yes, we have an open JIRA to make it an option to WARN and continue declarations, instead of failing all declarations when one fails for a problem like this... https://jira.springsource.org/browse/AMQP-266.

          Feel free to vote it up!

          Comment


          • #6
            Voted. Thanks for the help.

            Comment

            Working...
            X