Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12624

ActiveMQ Artemis AMQP integration issue with topic prefix hardcode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.21.1
    • 2.21.2, 2.22.1, 2.23.0
    • camel-amqp
    • None
    • Unknown

    Description

      Currently we are running Camel AMQP component against Active MQ 5 (Amazon MQ) we want to move to an Artemis solution but this hasn't worked seamlessly.

      In CAMEL-9204 I believe a hardcoded topic prefix of "topic://" was introduced I think for a workaround of an Active MQ 5 bug. 

      In Artemis this means Camel connects to a topic named "topic://example.topic.event" instead of "example.topic.event" and therefore receives no events.

      The only possible workaround is to manually create the connection factory which means then the topic prefix is not set. 

      My believe is that the hardcoded topic prefix is a bug and should be removed or an option to override at the AMQP component level should be introduced.

      Bug location: AMQPComponent.java line 59

      @Override
      protected void doStart() throws Exception {
          Set<AMQPConnectionDetails> connectionDetails = getCamelContext().getRegistry().findByType(AMQPConnectionDetails.class);
          if (connectionDetails.size() == 1) {
              AMQPConnectionDetails details = connectionDetails.iterator().next();
              JmsConnectionFactory connectionFactory = new JmsConnectionFactory(details.username(), details.password(), details.uri());
              connectionFactory.setTopicPrefix("topic://");
              setConnectionFactory(connectionFactory);
          }
          super.doStart();
      }
      

      Workaround:

      @Bean
      public ConnectionFactory amqpConnectionFactory() {
          return new JmsConnectionFactory(username, password, url);
      }
      

       

       

       

       

      Attachments

        Activity

          People

            dmvolod Dmitry Volodin
            open_matt_nz Matt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: