0 Replies Latest reply on Sep 13, 2016 6:12 AM by stephenwallen

    Discovering an ActiveMQ Broker in a Fuse Fabric working for components inside the Fabric but not outside.

    stephenwallen

      Hi,

       

      I'm having a problem with getting a java unit test to run when discovering the url of my main ActiveMQ broker in my local version of Fuse.  When I run the test with the direct tcp:// uri it works fine (using OpenWire), so accessing the broker isn't the problem.

       

      I'm using a uri of

      discovery:(fabric:<group-name>)

       

      which works for me in other components, but these other components are all inside the same fabric as the broker, so I'm assuming my problem lies with the extra stuff you need to do to support Discovery from outside the Fabric.

       

      My code:-

       

          
      System.setProperty("zookeeper.url", "http://localhost:2181");
          
      // **** GOT HERE *****
          
      connectionFactory = new ActiveMQConnectionFactory(username, password, connectionUrl);
          
      connection = connectionFactory.createConnection();
          
      connection.setExceptionListener(this);
          
      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          
      // **** DOESN'T REACH HERE *****
      
      

       

      I've added the following dependencies to my pom, to support discovery:-

       

          
      <!--  dependencies needed for discovery -->
          
      <dependency>
              
      <groupId>org.jboss.amq</groupId>
              
      <artifactId>mq-fabric</artifactId>
              
      <version>6.1.1.redhat-445</version>
          
      </dependency>
          
      <dependency>
              
      <groupId>io.fabric8</groupId>
              
      <artifactId>fabric-groups</artifactId>
          
      </dependency>
          
      <dependency>
              
      <groupId>io.fabric8</groupId>
              
      <artifactId>fabric-zookeeper</artifactId>
          
      </dependency>
          
      <dependency>
              
      <groupId>org.osgi</groupId>
              
      <artifactId>org.osgi.core</artifactId>
          
      </dependency>
          
      <dependency>
              
      <groupId>org.osgi</groupId>
              
      <artifactId>org.osgi.compendium</artifactId>
          
      </dependency>
      
      

       

       

      The code seems to hang on the final 'createSession' line. No errors or logging, just a hung test.

       

      Has anyone seen anything similar?