Using multicast factory

Help
2002-10-08
2002-10-09
  • Christian Meunier

    I am trying to leverage lrmp so i can avoid to run any jms server.

    i modified my code so the topic connection is factored by the MulticastTopicConnectionFactory using 224.1.2.3 port 1024

    When i try to publish a message i got the following exception:

    com.ubermq.jms.client.JMSIOException: output operation failed
        at com.ubermq.jms.client.impl.TopicSession$LocalTopicPublisher.outputMessageDatagram(TopicSession.java:490)
        at com.ubermq.jms.client.impl.TopicSession$LocalTopicPublisher.publish(TopicSession.java:408)
        at com.ubermq.jms.client.impl.TopicSession$LocalTopicPublisher.publish(TopicSession.java:312)

    If there something i need to care about when dealing with mulicast connection instead of unicast ?

    Thanks in advance.

     
    • Christian Meunier

      import com.ubermq.jms.client.MulticastTopicConnectionFactory;
      import javax.jms.*;

      public class SimpleMulticastTest
      {
          private static TopicConnectionFactory topicConnectionFactory = null;
          private static TopicConnection        topicConnection = null;
          private static TopicSession           topicSession = null;
          private static Topic                  cacheTopic = null;
          private static TopicPublisher         topicPublisher = null;

          public static void main(String[] args)
          {
              try
                  {
                      topicConnectionFactory = new MulticastTopicConnectionFactory("224.10.10.10",5555);
                      topicConnection = topicConnectionFactory.createTopicConnection();
                      topicSession = topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
                      cacheTopic = topicSession.createTopic("cacheTopic");
                      topicPublisher = topicSession.createPublisher(cacheTopic);
                      topicConnection.start();

                      Message message = topicSession.createMessage();
                      topicPublisher.publish(message);

                      topicConnection.close();
                  }
                  catch (JMSException e)
                  {
                      e.printStackTrace();
                  }
          }
      }

       
    • Jimmy P

      Jimmy P - 2002-10-08

      Hello there,
      This was a bug in the LRMP implementation. It is fixed now, and I released UberMQ 1.0.1, which contains the fix. 

      The sources have a JUnit test case that you can run in order to check that things are working on your network.

      Good luck, and let me know if you run into any other problems.
      James

       
      • Christian Meunier

        Thanks a lot it works perfectly now

         

Log in to post a comment.