This section assumes that you are using WebSphere MQ version
7.0. Before you can run an application that connects to a WebSphere MQ queue manager, you must
configure the queue manager.
For a publish/subscribe application,
some additional configuration is required if you are using Queued
Publish/Subscribe interface.
Before you begin
Before starting this task, you must do the following:
- Make sure that your application has access to a queue manager that is
running.
- If your application is a publish/subscribe application and uses
Queued Publish/Subscribe interface, make sure that “PSMODE” attribute
is set to “ENABLED” on the queue manager.
- Make sure that your application uses a connection factory whose
properties are set appropriately to connect to the queue manager.
If your application is a publish/subscribe application, make sure
that the appropriate connection factory properties are set for using
the broker. For more information about the properties of a connection
factory, Properties of ConnectionFactory.
You configure the
queue manager and broker
to run
XMS applications
in the same way that you configure the queue manager and queued publish/subscribe
interface to run WebSphere MQ JMS applications. The following steps
summarize what you need to do:
Steps for this task
Procedure
- On the queue manager, create
the queues that your application needs.
For information
about how to do this, see the WebSphere MQ System
Administration Guide.
If your application is a publish/subscribe application
and uses Queued Publish/Subscribe interface that needs access to WebSphere
MQ JMS system
queues, wait until Step 4.a before
creating the queues.
- Grant the user ID associated with your application the
authority to connect to the queue manager and the
appropriate authorities to access the queues.
For information
about how to do this, see the WebSphere MQ System
Administration Guide. If your application connects to the queue manager in client
mode, see also WebSphere MQ Clients or WebSphere MQ Security.
- If your application connects to the queue manager in client
mode, make sure that a server connection channel is defined at the queue manager and that
a listener has been started.
For information about how
to do this, see WebSphere MQ Clients.
You
do not need to perform this step for each application that connects
to the queue manager.
One server connection channel definition and one listener can support
all the applications that connect in client mode.
- If your application is a publish/subscribe application,
and uses Queued Publish/Subscribe interface, perform the following
steps.
- On the queue manager, create
the WebSphere
MQ JMS system
queues by running the script of MQSC commands supplied with WebSphere MQ. Make sure
that the user ID associated with the broker has the authorities it
needs to access the queues.
For information about where
to find the script and how to run it, see WebSphere MQ Using Java.
You
need to perform this step only once for the queue manager. The same
set of WebSphere
MQ JMS system
queues can support all XMS and WebSphere
MQ JMS applications
that connect to the queue manager.
- Grant the user ID associated with your application the
authorities it needs to access the WebSphere
MQ JMS system
queues.
For information about what authorities the user
ID needs, see WebSphere MQ Using Java.
- For a broker of WebSphere Event Broker or WebSphere
Message Broker, create
and deploy a message flow to service the queue where applications
send messages that they publish.
The basic message flow
comprises an MQInput message processing node to read the published
messages and a Publication message processing node to publish the
messages.
For information about how to create and deploy a message
flow, see the WebSphere Event Broker or WebSphere
Message Broker Information
Center.
You do not need to perform this step if a suitable message
flow is already deployed at the broker.
You can now start your application.