Starting the Subscriber Clients

You start the subscribers first because they enable you to observe the messages being received when you start the publisher.

Procedure

To start user1 as a subscriber:

  1. In the first command line window, navigate to EMS_HOME/samples/java.
  2. Enter setup to set the environment and classpath:
    > setup
  3. Execute the tibjmsMsgConsumer client to assign user1 as a subscriber to the myTopic topic:
    > java tibjmsMsgConsumer -topic myTopic -user user1

    The screen will display a message showing that user1 is subscribed to myTopic.

To start user2 as a subscriber:

  1. In the second command line window, navigate to the EMS_HOME/samples/java folder.
  2. Enter setup to set the environment and classpath:
    > setup
  3. Execute the tibjmsMsgConsumer application to assign user2 as a subscriber to the myTopic topic:
    > java tibjmsMsgConsumer -topic myTopic -user user2

    The screen will display a message showing that user2 is subscribed to myTopic.

    Note: The command windows do not return to the prompt when the subscribers are running.