1 Reply Latest reply on Feb 22, 2011 4:13 PM by clebert.suconic

    Are topics created by the core api available to JMS clients?

    glynbach

      I'm running the standalone server with the JNDIServer and JMSServerManager enabled. I connect with a core client api to the server using TransportConfiguration with the ClientSessionFactory. I have then been creating topics as such:

       

      ClientProducer producer = session.createProducer();

      Topic topicEUR1S = HornetQJMSClient.createTopic("jms.topic.EUR.TS.1000");

      Topic topicEUR1M = HornetQJMSClient.createTopic("jms.topic.EUR.TS.60000");

      ClientMessage message = session.createMessage(true);

      message.putDoubleProperty("CLOSE", 1.2345);

      connection.start();

      producer.send(topicEUR1S.getTopicName(), message);

       

      Then another client using the JMS api attempts to lookup one of the topics:

       

      Hashtable<String, String> args = new Hashtable<String, String>();

      args.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

      args.put(Context.PROVIDER_URL, "jnp://localhost:1099");

      ic = new InitialContext(args);

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");

      connection = cf.createConnection();

       

      Topic topEUR1S = (Topic)ic.lookup("/topic/EUR/TS/1000");

       

      But it's not available. (I can lookup a topic that is configured in the hornetq-jms.xml). Should I expect the topics that are created by the core api to be populated into the JNDI server?

       

      Thanks

        • 1. Are topics created by the core api available to JMS clients?
          clebert.suconic

          There's no such thing as topics on the core-API. Everything is just address and queues.

           

          Now if you want to send through core-api, and receive on the JMS layer, you have to follow the conventions used by the JMS layer in terms of address names (jms.topic.TopicName), and the subscription queues (if you are consuming on the core-api and sending on JMS).

           

          That information should be available on the user's manual.