4 Replies Latest reply on Jul 7, 2014 7:14 AM by yairogen

    JMS Topic usage based on HornetQ JMS API

    yairogen

      I am trying to work with JMS API without initial context lookups - should this work?

       

      I am creating an array of TransportConfiguration.

       

      creating the connection like this:

       

      HornetQConnectionFactory connectionFactoryWithHA = HornetQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.TOPIC_CF, transportConfigurationsArray);
      Connection jmsConnection = connectionFactoryWithHA.createConnection();
      Session session = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      

       

      I create the queue using the management API so I have a destination as viewed in JConsole and a registered consumer (also verified in JConsole).

       

      My topic name is: jms.topic.myFirstTopic.

       

      I create producer like this:

       

      session..createProducer(new HornetQTopic("jms.topic.myFirstTopic"))
      

       

      now - although judging from JConsole all queue exists and all is well, we fail on:

       

      Caused by: javax.jms.InvalidDestinationException: Destination jms.topic.myFirstTopic does not exist
        at org.hornetq.jms.client.HornetQSession.createProducer(HornetQSession.java:332)