0 Replies Latest reply on Jul 28, 2011 5:07 AM by Anzor Israilov

    Hornetq 2.2.5 Topics Does Not Work

    Anzor Israilov Newbie



      We are using hornetq.2.2.5 + jboss 5.1.0.GA in a clustered environment. The configuration is pretty basic nothing special, just several topics and queues in hornetq-jms.xml.


      There is no problem with queues - they work really fine. But topics does not work: the problem is that sending to the topic does not raise any exception but no messages really arrive to the destination. At least jmx-console shows 0 in messages counter and the consumer cannot consume messages from the topic - again no exceptions raised, just like there are no messages in the topic at all.


      Here is how we send messages to the topic:


      Hashtable<String, String> jndiParameters = new Hashtable<String, String>();
      jndiParameters.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      jndiParameters.put("java.naming.factory.url.pkgs=", "org.jboss.naming:org.jnp.interfaces");
      initialContext = new InitialContext(jndiParameters);
      ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
      connection = cf.createConnection();                
      Topic topic = (Topic) initialContext.lookup("/topic/TestsOnlyTopic");
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);                    
      TextMessage msg = session.createTextMessage("TEXT MESSAGE");                        
      MessageProducer producer = session.createProducer(topic);


      Could you please advise what to do to make it work?