Search code examples
springspring-rabbit

Unexpected behaviour with Rabbit Admin


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 ?


Solution

  • Resolved in thread

    http://forum.springsource.org/showthread.php?134488-Unexpected-behaviour-with-Rabbit-Admin

    Turns out the logging is very weak around this area and debug level is required to find the error.

    Problem was a mismatch between ttl on the broker and the config for another queue.