8 Replies Latest reply on Feb 10, 2014 4:06 AM by Darren Jones

    WildFly CR1 HornetQ over https: HQ119013: Timed out waiting to receive cluster topology

    Darren Jones Newbie

      I've been attempting to configure HornetQ to use WildFly/Undertow's http-upgrade feature, but over the https port instead of the http port. I can successfully get a TopicConnection using http, but not using https - I get this exception:

       

      Exception in thread "main" javax.jms.JMSException: Failed to create session factory

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:676)

        at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:196)

        at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:191)

        at hornetq.test.HornetQTest.main(HornetQTest.java:26)

      Caused by: HornetQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=HQ119013: Timed out waiting to receive cluster topology. Group:null]

        at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:950)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:672)

        ... 8 more

       

      I've managed to create a very simple test client that demonstrates the problem:

       

      public class HornetQTest

      {

          public static void main(String[] args) throws NamingException, JMSException

          {

              // This "naming" group of options configures the options required for looking up non-EJBs via JNDI.

              final Properties jndiConfig = new Properties();

              jndiConfig.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

              jndiConfig.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");

       

              System.setProperty("org.hornetq.ssl.trustStore", HornetQTest.class.getResource("client.truststore").toExternalForm());

              System.setProperty("org.hornetq.ssl.trustStorePassword", "");

       

              InitialContext ctx = new InitialContext(jndiConfig);

              TopicConnectionFactory factory = (TopicConnectionFactory) ctx.lookup("jms/HTTPConnectionFactory");

              TopicConnection topicConnection = factory.createTopicConnection();

              System.out.println("Got topicConnection " + topicConnection);

          }

      }

       

      There is a client.truststore file in the same package as the test class with no password.

       

      My configuration is based upon the WildFly CR1 standalone-full.xml configuration. These are the changes I made:

       

      First of all, disable hornetq security (just so I don't need to supply username/password when creating topic connections):

       

              <subsystem xmlns="urn:jboss:domain:messaging:2.0">

                  <hornetq-server>

                      <security-enabled>false</security-enabled>

       

      Next I add an https listener to the undertow subsystem:

       

              <subsystem xmlns="urn:jboss:domain:undertow:1.0">

                  <server name="default-server">

                      <http-listener name="default" socket-binding="http"/>

                      <https-listener name="undertow-https" socket-binding="https" security-realm="ApplicationRealm"/>

       

      I add a server identity to the application realm:

       

                  <security-realm name="ApplicationRealm">

                      <server-identities>

                          <ssl>

                              <keystore path="server.ssl.keystore" relative-to="jboss.server.config.dir" keystore-password="<password>"/>

                          </ssl>

                      </server-identities>

       

      At this point, my test client works fine and prints that it has a topic connection - but hornetq is using http. To switch hornetq over to https, I am changing the following lines of configuration:

       

      <subsystem xmlns="urn:jboss:domain:messaging:2.0">

                  <hornetq-server>

                      ...

                      <connectors>

                          <http-connector name="http" socket-binding="https">

                              <param key="ssl-enabled" value="true"/>

                          </http-connector>

                          ...

                      </connectors>

                      <acceptors>

                          <http-acceptor name="http" http-listener="undertow-https"/>

       

      After these changes, I get the cluster topology timeout message. I haven't turned up anything on the web to help so far.

       

      Any ideas on how to get this working?