Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Getting Started : Point-to-Point Messaging Example

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 134. For more information on the commit command, see commit on page 131 and autocommit on page 131.
Start the Sender and Receiver Clients
1.
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.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved