user guide ?

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

    Hi , i was wondering if you got a little user guide or few sample code to start with uberMq ?

    I would like to see if i can use it to implement a distributed cache.

    Thanks in advance

     
    • Jimmy P

      Jimmy P - 2002-09-27

      Hello,
      Unfortunately there is no user guide yet. Sorry about that! There is, however, Javadoc and a pretty comprehensive JUnit test suite that should help you get started with the software. Look at www.ubermq.com for the javadoc. The class RegressionTestCase in com.ubermq.jms.client.test is the unit test.

      You may also want to check back in a couple of days, because I am going to be releasing version 0.9, which will be the last incremental rev before we go to 1.0 (production/stable).

      Good luck on your distributed cache project.  Keep me updated on your progress if you feel so inclined!

      James
      project admin

       
      • Christian Meunier

        I tried some a simple case with no luck ;)

        I start a jms provider with this code:

        import com.ubermq.jms.server.MessageServer;

        public class JmsProvider
        {
            private static MessageServer ms = null;

            public static void main (String[] Args)
            {
                ms = new MessageServer(new String[] {"server.properties"});
                new Thread(ms).start();
            }
        }

        I then try to create a topic subscriber:

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

        public class JmsSubscriber
        {
            public static void main(String[] args)
            {
                TopicConnectionFactory f = null;
                TopicConnection  tc = null;
                TopicSession ts = null;
                Topic theTopic = null;

                try
                {
                    f = new UnicastTopicConnectionFactory("localhost", 3999);
                    tc = f.createTopicConnection();
                    ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

                    theTopic = ts.createTopic("test");
                    TopicSubscriber s = ts.createSubscriber(theTopic);
                    Message m = s.receive(1000);

                    if(m!=null)
                        System.out.println(m.getIntProperty("ordinal"));
                    else
                        System.out.println("message is null");

                } catch (JMSException e) {
                    e.printStackTrace();
                }
                finally
                {
                    if(tc!=null)

                        try {
                            tc.close();
                        } catch (JMSException e) {
                            e.printStackTrace();
                        }
                }

            }
        }

        Once i run it, the program exit saying the mesage is null which is normal but now the jvm running the Jms Provider is eating all my cpu... i have to kill it manually.

        I am obviously doing something wrong but what ?
        Thanks in advance

        PS: Is it mandatory to explicitly call start() for the topic connection ?

         
    • Jimmy P

      Jimmy P - 2002-10-01

      Hello, that is not normal. Would you mind trying the same code using the 1.0 release that I just put up? The code looks pretty correct to me.

      You do have to start() the connection explicitly before messages start coming in. That is part of the JMS spec.

       
      • Christian Meunier

        Just tried with 1.0, same thing happens

        Fixed the code with tc.start(); but it does not fix the behaviour regarding the jvm running the jms provider.

        Using latest jvm from sun 1.4.1 on Win XP

         
    • Jimmy P

      Jimmy P - 2002-10-03

      OK last try - I only included the class files in the last upload. The new archive has a bunch of stuff in there, including all of the source, some shell scripts, and all of the third-party jar files required to run.

      When you download, you should be able to run bin/server.bat and the message server should come up with no troubles.

       
      • Christian Meunier

        When i consume messages asynchronously all work fine, there might be a bug with sync message consuming.

         

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks