Copyright © TIBCO Software Inc. All Rights Reserved

> Point-to-Point Messaging Example
> This section demonstrates how to use point-to-point messaging, as described in Point-to-Point.
> Create a Queue
> In the point-to-point messaging model, client send messages to and receive messages from a queue.
> To create a new queue in the administration tool, use the create queue command to create a new queue named myQueue:
> tcp://localhost:7222> create queue myQueue
> For more information on the create queue command, refer to create queue on page 126. For more information on the commit command, see commit on page 123 and autocommit on page 123.
> Start the Sender and Receiver Clients

> 1. | Open two command line windows and in each window navigate to the EMS_HOME/samples/java folder.

> 2. | In each command line window, enter setup to set the environment and classpath:

> > setup

> 3. | In the first command line window, execute the tibjmsMsgProducer application to direct user1 to place some messages to the myQueue queue:

> > java tibjmsMsgProducer -queue myQueue -user user1 Hello User2

> 4. | In the second command line window, execute the tibjmsMsgConsumer client to direct user2 to read the messages from the message queue:

> > java tibjmsMsgConsumer -queue myQueue -user user2
> The messages placed on the queue are displayed in the receiver’s window.

> | Messages placed on a queue by the sender are persistent until read by the receiver, so you can start the sender and receiver clients in any order.

Copyright © TIBCO Software Inc. All Rights Reserved