Announcement Announcement Module
No announcement yet.
Spring AMQP 1.3.4 is Now Available Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring AMQP 1.3.4 is Now Available

    This fixes a problem with the pom for spring-retry in Friday's 1.3.0.RELEASE.

    1.3.2 Adds a default error handler to prevent endless retries of messages that have conversion failures.

    1.3.3 Adds support for rabbitmq amqp-client 3.3.x

    1.3.4 Restores listener exception logging.
    Last edited by Gary Russell; Jun 2nd, 2014, 06:41 PM.

  • #2
    Hi Gary,

    I am getting following exception when switched from 1.1.4 to 1.3.2
    Exception in thread "SimpleAsyncTaskExecutor-1" java.lang.NoSuchMethodError: com.rabbitmq.client.ShutdownSignalException.getRea son()Ljava/lang/Object;
    at org.springframework.amqp.rabbit.connection.RabbitU tils.isNormalShutdown(
    at org.springframework.amqp.rabbit.listener.SimpleMes sageListenerContainer$AsyncMessageProcessingConsum

    Here is the reason I found:

    ShutdownSignalException.getReason() returns 'com.rabbitmq.client.Method', where as in 'RabbitUtils.isNormalShutdown' it is used to return Object. (ObjectshutdownReason=sig.getReason()

    Can you please look into it as it is stopping us from migration


    • #3
      This looks like a recent change to the rabbit client; can you try with the 3.2.4 client library?


      • #4
        I can confirm there are a number of breaking changes in the 3.3.x client. I opened a JIRA issue to resolve them


        • #5
          It works with amqp-client:3.2.4. Thanks for quick response.


          • Gary Russell
            Gary Russell commented
            Editing a comment
            Spring AMQP 1.3.3 supporting the 3.3.x client is now available in and should be in Maven Central in a few hours.

        • #6
          When defining listener-container in applicationContext.xml, looks like we are forced to define queues; I get BeanCreationException if queues or queue-names are not provided. We would like to add queues via addQueues before starting the listener. Is this possible?


          • #7
            Can you provide a full stack trace? I don't think that check is done until the container is start() ed. So, you should be ok if you set autoStartup="false".


            • #8
              Yes, I have set autoStartup=false.

              Here's the stacktrace

              SEVERE: Caught exception while allowing TestExecutionListener [ [email protected]] to prepare test instance [[email protected]]
              java.lang.IllegalStateException: Failed to load ApplicationContext
              at org.springframework.test.context.CacheAwareContext LoaderDelegate.loadContext(CacheAwareContextLoader
              at org.springframework.test.context.DefaultTestContex t.getApplicationContext( 1)
              at yInjectionTestExecutionListener.injectDependencies ( )
              at yInjectionTestExecutionListener.prepareTestInstanc e( )
              at org.springframework.test.context.TestContextManage r.prepareTestInstance(
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.createTest(SpringJUnit4ClassRunner.j ava:212)
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner$1.runReflectiveCall(SpringJUnit4Clas
              at org.junit.internal.runners.model.ReflectiveCallabl
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.methodBlock(SpringJUnit4ClassRunner. java:291)
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:232)
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:89)
              at org.junit.runners.ParentRunner$ java:238)
              at org.junit.runners.ParentRunner$1.schedule(ParentRu
              at org.junit.runners.ParentRunner.runChildren(ParentR
              at org.junit.runners.ParentRunner.access$000(ParentRu
              at org.junit.runners.ParentRunner$2.evaluate(ParentRu
              at org.junit.internal.runners.statements.RunBefores.e valuate(
              at org.springframework.test.context.junit4.statements .RunBeforeTestClassCallbacks.evaluate(RunBeforeTes
              at org.junit.internal.runners.statements.RunAfters.ev aluate(
              at org.springframework.test.context.junit4.statements .RunAfterTestClassCallbacks.evaluate(RunAfterTestC
              at va:309)
              at org.springframework.test.context.junit4.SpringJUni )
              at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR
              at org.eclipse.jdt.internal.junit.runner.TestExecutio
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(
              Caused by: org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Listener 'queue-names' or 'queues' attribute must be provided.
              Offending resource: URL [file:/[...snipped...]/processor/target/classes/spring/applicationContext.xml]
              at org.springframework.beans.factory.parsing.FailFast ProblemReporter.error( :70)
              at org.springframework.beans.factory.parsing.ReaderCo ntext.error(
              at org.springframework.beans.factory.parsing.ReaderCo ntext.error(
              at org.springframework.amqp.rabbit.config.ListenerCon tainerParser.parseListener(ListenerContainerParser .java:163)
              at org.springframework.amqp.rabbit.config.ListenerCon tainerParser.parse( )
              at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(
              at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition
              at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition
              at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau
              at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.doRegisterBeanDefinitions(
              at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De
              at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit
              at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio
              at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR
              at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR
              at BeanDefinitionReader.loadBeanDefinitions(AbstractB
              at BeanDefinitionReader.loadBeanDefinitions(AbstractB
              at BeanDefinitionReader.loadBeanDefinitions(AbstractB
              at BeanDefinitionReader.loadBeanDefinitions(AbstractB
              at enericContextLoader.loadBeanDefinitions(AbstractGe
              at enericContextLoader.loadContext(AbstractGenericCon
              at enericContextLoader.loadContext(AbstractGenericCon
              at elegatingSmartContextLoader.delegateLoading(Abstra
              at elegatingSmartContextLoader.loadContext(AbstractDe
              at org.springframework.test.context.CacheAwareContext LoaderDelegate.loadContextInternal(CacheAwareConte
              at org.springframework.test.context.CacheAwareContext LoaderDelegate.loadContext(CacheAwareContextLoader
              ... 27 more

              Last edited by ashburnite; May 14th, 2014, 07:45 AM.


              • #9
                Configuration problem: Listener 'queue-names' or 'queues' attribute must be provided.
                It says that one of these attribtes should be provided.
                Since you are going to add queues at runtime, I'd suggest to provide some fake queueName and remove it before real queus initialization.
                Everything is done after container startup


                • #10
                  Or you can just wire up the SimpleMessageListenerContainer as a <bean/>; that check is being done by the namespace parser and it requires one or the other attribute.

                  The container itself doesn't check that it has at least one queue until it's start() ed.


                  • #11
                    Thanks both! Is it your intent to have queue or queue-name as a required attribute? why not make it optional and validate container during startup?


                    • #12
                      We could relax that requirement; it has just never come up before. Feel free to open a JIRA 'Improvement; issue:


                      • #13
                        Update: Fixed.
                        The exception was being raised on AutorecoveringConnection [line: 491] - recoverConsumers(), where it tried to, for each queue, recover all consumers - but couldn't. Setting the flag topologyRecover to false fixed that.


                        Hi guys,

                        I was having some problems with the ShutdownSignalException and this new version fixed it, but a new one showed up right after
                        I also noticed that my consumers aren't being closed - I had 15 consumers on a given queue and after restarting Rabbit I ended up with 30, then 45, and so on...
                        No exceptions are raised during the restart, only later when I try to consume messages (stacktrace below). Debugging I saw that the code does go through restart()
                        on SimpleMessageListenerContainer, without throwing an exception.s

                        Any ideas?


                        Caught an exception when recovering topology Caught an exception while recovering consumer amq.ctag-hw7gxNv9AJfUR91PMeBKkw
                        com.rabbitmq.client.TopologyRecoveryException: Caught an exception while recovering consumer amq.ctag-hw7gxNv9AJfUR91PMeBKkw
                        at com.rabbitmq.client.impl.recovery.AutorecoveringCo nnection.recoverConsumers(AutorecoveringConnection .java:491)
                        at com.rabbitmq.client.impl.recovery.AutorecoveringCo nnection.beginAutomaticRecovery(AutorecoveringConn
                        at com.rabbitmq.client.impl.recovery.AutorecoveringCo nnection.access$000( 48)
                        at com.rabbitmq.client.impl.recovery.AutorecoveringCo nnection$1.shutdownCompleted(AutorecoveringConnect
                        at com.rabbitmq.client.impl.ShutdownNotifierComponent .notifyListeners( )
                        at com.rabbitmq.client.impl.AMQConnection$ n(
                        Caused by: com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - attempt to reuse consumer tag 'amq.ctag-liy1EPIPVKqQ9yOahdLKzw', class-id=60, method-id=20)
                        at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(A
                        at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel .java:223)
                        at com.rabbitmq.client.impl.ChannelN.basicConsume(Cha
                        at com.rabbitmq.client.impl.recovery.AutorecoveringCh annel.basicConsume(
                        at com.rabbitmq.client.impl.recovery.RecordedConsumer .recover(
                        at com.rabbitmq.client.impl.recovery.AutorecoveringCo nnection.recoverConsumers(AutorecoveringConnection .java:484)
                        ... 6 more
                        Last edited by lleite; May 14th, 2014, 12:51 PM.


                        • #14
                          How are you killing RabbitMQ? When you say 30, then 45, do you mean on the admin console or you have that number of consumer threads. It sounds like the server bounce (socket close) is not being propagated to the client.


                          • #15
                            Also what is your consumer cache size?