JMS client program flow

The steps in the table below describe the program flow in a typical JMS client:

Step

Action

For more information

1

Define the initial naming context.

See “Defining the initial naming context”.

2

Obtain a connection factory.

See “Looking up a connection factory”.

3

Create a connection.

See “Creating connections”.

4

Create one or more sessions.

See “Creating sessions”.

5

Look up message queues and topics.

See “Looking up destinations”.

6

Create message producers and consumers.

See “Creating message producers and consumers”.

7

Send and receive messages.

See “Sending and receiving messages”.

Figure 3-1 illustrates the relationship of the objects in a JMS application.

Figure 3-1: JMS application