Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-1347

Configuring org.fusesource.mq.fabric.camel.AMQComponent in Blueprint results in Two Connection Factories Associated with the Component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • JBoss A-MQ 6.1, JBoss A-MQ 6.2
    • camel, fabric8
    • None
    • Workaround Exists
    • Hide

      Setting the configuration property on the component post-instantiation seems to work.

      Show
      Setting the configuration property on the component post-instantiation seems to work.
    • Hide

      Blueprint reproducer attached. Deploy the profile to a Fuse Fabric and look for the following statement in the log:

      ###################################################
      ConnectionFactory Redelivery Policy Max Redeliveries: 6
      AMQConnectionFactory Redelivery Policy Max Redeliveries: 0
      Calling getConfiguration.getConnectionFactory and getConfiguration.getActiveMQConnectionFactory on the same AMQComponent instance returns two different factories with differing configurations
      ###################################################

      Show
      Blueprint reproducer attached. Deploy the profile to a Fuse Fabric and look for the following statement in the log: ################################################### ConnectionFactory Redelivery Policy Max Redeliveries: 6 AMQConnectionFactory Redelivery Policy Max Redeliveries: 0 Calling getConfiguration.getConnectionFactory and getConfiguration.getActiveMQConnectionFactory on the same AMQComponent instance returns two different factories with differing configurations ###################################################

      When constructing the AMQComponent in blueprint or otherwise, an AMQConfiguration is instantiated by the AMQComponent constructor. In the AMQConfiguration constructor, the inherited (from org.apache.camel.component.jms.JMSConfiguration) connectionFactory attribute is never set, but a sub-class member, AMQConfiguration.activeMQConnectionFactory is. As a result, calling getConfiguration().getConnectionFactory() on the component results in a new (the first time) ConnectionFactory being instantiated and returned, instead of the configured ActiveMQConnectionFactory.Calls to getConfiguration().getActiveMQConnectionFactory() returns the expected / configured ActiveMQConnectionFactoryThis seems like unexpected behavior, as the ConnectionFactory returned by getConnectionFactory may not have the same settings / attributes as the ActiveMQConnectionFactory set in the blueprint / DSL.RedeliveryPolicy is used in the example reproducer.

              Unassigned Unassigned
              rhn-support-dhawkins Duane Hawkins
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: