0

I am trying to setup the OpenJMS on my machine and trying to run the basic example from command line. However, I am not able to figure out how to do it.

This is what I have done so far,

Run the Open JMS

➜  bin ./startup.sh
Using OPENJMS_HOME: /Users/gaurang.shah/Documents/personal/jms/openjms-0.7.7-beta-1
Using JAVA_HOME:    /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
OpenJMS 0.7.7-beta-1
The OpenJMS Group. (C) 1999-2007. All rights reserved.
http://openjms.sourceforge.net
11:46:59.353 INFO  [main] - Server accepting connections on tcp://192.168.2.12:3035/
11:46:59.355 INFO  [main] - JNDI service accepting connections on tcp://192.168.2.12:3035/
11:46:59.356 INFO  [main] - Admin service accepting connections on tcp://192.168.2.12:3035/
11:46:59.453 INFO  [main] - Server accepting connections on rmi://192.168.2.12:1099/
11:46:59.453 INFO  [main] - JNDI service accepting connections on rmi://192.168.2.12:1099/
11:46:59.454 INFO  [main] - Admin service accepting connections on rmi://192.168.2.12:1099/

Start the Sender

➜  basic ./run.sh Sender new_topic 1
Using OPENJMS_HOME: /Users/gaurang.shah/Documents/personal/jms/openjms-0.7.7-beta-1
Using JAVA_HOME:    /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
Using CLASSPATH:    ./:/Users/gaurang.shah/Documents/personal/jms/openjms-0.7.7-beta-1/lib/openjms-0.7.7-beta-1.jar
hello

Start the Receiver

➜  basic ./run.sh Receiver new_topic
Using OPENJMS_HOME: /Users/gaurang.shah/Documents/personal/jms/openjms-0.7.7-beta-1
Using JAVA_HOME:    /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
Using CLASSPATH:    ./:/Users/gaurang.shah/Documents/personal/jms/openjms-0.7.7-beta-1/lib/openjms-0.7.7-beta-1.jar

However, I am not able to get anything on the receiver side.

Gaurang Shah
  • 11,764
  • 9
  • 74
  • 137
  • For what it's worth, you might want to take a look at a more modern JMS implementation. OpenJMS 0.7.7-beta-1 was released in March 2007 (12 years ago!). – Justin Bertram Mar 04 '19 at 19:40

1 Answers1

0

In JMS if a message is sent to a topic then all the subscribers on that topic receive the message. If there are no subscribers on the topic then any message sent to the topic is discarded (i.e. the message is not stored). This is basic publish-subscribe semantics.

Therefore, if you send the message before you start your receiver/subscriber then it won't receive the message.

Start the receiver before sending the message and it should receive it.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43