Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-4293

ClassCastException in Jms.inboundGateway configureListenerContainer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.10
    • Fix Version/s: 5.0 M5
    • Component/s: DSL, JMS Support
    • Labels:
      None
    • Environment:
      Java 8, ActiveMQ

      Description

      When trying to set a property of the JMS message listener via configureListenerContainer i.e.:

      @Bean
      public IntegrationFlow inboundJmsGatewayFlow(ConnectionFactory connectionFactory) {
          return IntegrationFlows
                  .from(Jms.inboundGateway(connectionFactory)
                          .destination("jms-test")
                          .defaultReplyQueueName("jms-test-reply")
                          .configureListenerContainer(c -> c.sessionTransacted(false))
                  )
                  .channel("inboundFlow.input")
                  .get();
      }
      

      the following exception is thrown:

      java.lang.ClassCastException: org.springframework.integration.dsl.jms.JmsListenerContainerSpec cannot be cast to org.springframework.integration.dsl.jms.JmsDefaultListenerContainerSpec

      A workaround is to use .get() like so: .configureListenerContainer(c -> c.get().setSessionTransacted(false))

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            marinoj Marino A. Jonsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: