IBM WebSphere MQ jobs

Before creating IBM WebSphere MQ jobs, you must complete some prerequisite steps.

Prerequisite steps

To create an IBM WebSphere MQ job definition, you must first complete the prerequisite steps that are listed in the following procedure.

  1. Install a supported version of IBM WebSphere MQ.
  2. On the IBM WebSphere MQ server workstation, create a user to use in the HCL Workload Automation job definition that is not a privileged user. On UNIX operating systems, the user must not belong to the mqm group created at installation time. On Windows operating systems, the user cannot be a member of the Administrator group.
  3. Allow the user that is defined in step 1 to connect to its queue manager, queues, and channels. For the queue manager associated to the user, set the Display for the Administration authority, and the Connect and the Inquire for MQI authority. For more information about IBM WebSphere MQ users, see http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.sec.doc/q013290_.htm.

IBM WebSphere MQ job definition

An IBM WebSphere MQ job enables communication among applications that run in different distributed environments at different times.

A description of the job properties and valid values are detailed in the context-sensitive help in the Dynamic Workload Console by clicking the question mark (?) icon in the top-right corner of the properties pane.

For information about creating jobs using the various supported product interfaces, see Defining a job.

For more information about IBM WebSphere MQ, see the IBM WebSphere MQ online product documentation in IBM Knowledge Center.

The following table lists the required and optional attributes for IBM WebSphere MQ jobs:
Table 1. Required and optional attributes for the definition of an IBM WebSphere MQ job
Attribute Description and value Required
MQ Server The host name or IP address of the workstation where IBM WebSphere MQ is installed.
MQ Port The port number of the workstation where IBM WebSphere MQ is listening.
User name The name of the user authorized to run the IBM WebSphere MQ commands on the IBM WebSphere MQ server.
Password The password that is associated with the user that is authorized to run the IBM WebSphere MQ commands on the IBM WebSphere MQ server.
MQ Queue Manager The name of the IBM WebSphere MQ Queue Manager.
MQ Channel The name of the IBM WebSphere MQ Channel.
Operation
Request/Response
The IBM WebSphere MQ Request/Response operation type.
Publish
The IBM WebSphere MQ Publish operation type.
MQ Request Queue The name of the IBM WebSphere MQ Queue to which send the request message.
MQ Response Queue The name of the IBM WebSphere MQ Queue to which receive the response message.
Wait Interval (sec) The number of seconds to wait for the request/response operation to complete.
MQ Queue The name of the IBM WebSphere MQ Queue to which send the publish message.
MQ Topic The name of the IBM WebSphere MQ Topic to which send the publish message.
MQ Message The message to include in the Request or Publish MQ Operation.

Scheduling and stopping the job in HCL Workload Automation

You schedule HCL Workload Automation IBM WebSphere MQ jobs by defining them in job streams. Add the job to a job stream with all the necessary scheduling arguments and submit the job stream.

You can submit jobs by using the Dynamic Workload Console, Application Lab or the conman command line. See Scheduling and submitting jobs and job streams for information about how to schedule and submit jobs and job streams using the various interfaces.

After submission, when the job is running and is reported in EXEC status in HCL Workload Automation, you can stop it if necessary, by using the kill command. However, this action is effective only for the Request/Response scenario, therefore the HCL Workload Automation processes do not wait to receive a response from the IBM WebSphere MQ job.

Monitoring the job

If the HCL Workload Automation agent stops when you submit the HCL Workload Automation IBM WebSphere MQ job or while the job is running, as soon as the agent restarts in the Request/Response scenario, HCL Workload Automation begins monitoring the job from where it stopped and waits for the Response phase.

For information about how to monitor jobs using the different product interfaces available, see Monitoring HCL Workload Automation jobs.

Job properties

While the job is running, you can track the status of the job and analyze the properties of the job. In particular, in the Extra Information section, if the job contains variables, you can verify the value passed to the variable from the remote system. Some job streams use the variable passing feature, for example, the value of a variable specified in job 1, contained in job stream A, is required by job 2 in order to run in the same job stream.

For more information, see Properties for IBM WebSphere MQ jobs.

For information about how to display the job properties from the various supported interfaces, see Analyzing the job log.

For example, from the conman command line, you can see the job properties by running:
conman sj <MQ_job_name>;props
where <MQ_job_name> is the IBM WebSphere MQ job name.
For an IBM WebSphere MQ job in the Extra Information section of the output command, you see the following properties:
Extra Information
  Channel = Channel1
  CorrelationID = 414D5120514D5F6E6330363030303220D215305320024304
  Manager = QueueManager1
  Message ID = 414D5120514D5F6E6330363030303220D215305320024303
  Response message = Received original message: 'Info done'
  Request Message = Need info
  Port = 1414
  Server = NY1_Win.usa.com
where
Channel
The name of the IBM WebSphere MQ Channel that you specify in the MQ Channel field.
CorrelationID
The ID that correlates the request and response.
Manager
The name of the IBM WebSphere MQ Queue Manager that you specify in the MQ Queue Manager field.
Message ID
The IBM WebSphere MQ message ID.
Response message
The IBM WebSphere MQ response message.
Request Message
The IBM WebSphere MQ request message that you specify in the MQ Message field.
Port
The port number of the workstation where IBM WebSphere MQ is listening that you specify in the MQ Port field.
Server
The host name or IP address of the workstation where IBM WebSphere MQ is installed that you specify in the MQ Server field.

You can export the IBM WebSphere MQ job properties that you can see in the Extra Information section, to a successive job in the same job stream instance. For more information about the list of job properties that you can export, see Properties for IBM WebSphere MQ jobs.

The following example shows the job definition for an IBM WebSphere MQ job that performs a Request/Response operation:
$JOBS
WASMQ_WS#REQRES
 TASK
 <?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdl"
xmlns:jsdlwebspheremq=
"http://www.abc.com/xmlns/prod/scheduling/1.0/jsdlwebspheremq" name="WEBSPHEREMQ">
  <jsdl:application name="webspheremq">
    <jsdlwebspheremq:webspheremq>
			<jsdlwebspheremq:WebSphereMQParameters>
			<jsdlwebspheremq:WebSphereMQMainPanel>
		<jsdlwebspheremq:PropertyFileGroup>
		<jsdlwebspheremq:option>webspheremqServer4.properties</jsdlwebspheremq:option>
					</jsdlwebspheremq:PropertyFileGroup>
					<jsdlwebspheremq:PropertiesGroup>
						<jsdlwebspheremq:server>localhost</jsdlwebspheremq:server>
						<jsdlwebspheremq:port>1414</jsdlwebspheremq:port>
						<jsdlwebspheremq:user>agentuser</jsdlwebspheremq:user>
				<jsdlwebspheremq:password>
       {aes}DrM1RhdBkMwl9YGD9QW21NgEMlG8eE4N0VciTpzI8d8=</jsdlwebspheremq:password>
				<jsdlwebspheremq:manager>QM_ADMINIB_897G50K</jsdlwebspheremq:manager>
					<jsdlwebspheremq:channel>S_ADMINIB_897G50K   </jsdlwebspheremq:channel>
					</jsdlwebspheremq:PropertiesGroup>
					<jsdlwebspheremq:OperationGroup>
						<jsdlwebspheremq:RequestResponseGroup>
							<jsdlwebspheremq:request>default</jsdlwebspheremq:request>
							<jsdlwebspheremq:response>postcard</jsdlwebspheremq:response>
							<jsdlwebspheremq:timeout>300</jsdlwebspheremq:timeout>
							<jsdlwebspheremq:abendif>error</jsdlwebspheremq:abendif>
						</jsdlwebspheremq:RequestResponseGroup>
					</jsdlwebspheremq:OperationGroup>
				</jsdlwebspheremq:WebSphereMQMainPanel>
				<jsdlwebspheremq:WebSphereMQMessagePanel>
					<jsdlwebspheremq:MessageGroup>
						<jsdlwebspheremq:message>Hello World</jsdlwebspheremq:message>
					</jsdlwebspheremq:MessageGroup>
				</jsdlwebspheremq:WebSphereMQMessagePanel>
			</jsdlwebspheremq:WebSphereMQParameters>
		</jsdlwebspheremq:webspheremq>
  </jsdl:application>
</jsdl:jobDefinition>
 RECOVERY STOP
The following example shows the job definition for a WebSphere MQ job that performs a Publish operation:
$JOBS
WASMQ_WS#PUBLISH
 TASK
 <?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdl"
xmlns:jsdlwebspheremq=
"http://www.abc.com/xmlns/prod/scheduling/1.0/jsdlwebspheremq" name="WEBSPHEREMQ">
  <jsdl:application name="webspheremq">
    <jsdlwebspheremq:webspheremq>
			<jsdlwebspheremq:WebSphereMQParameters>
				<jsdlwebspheremq:WebSphereMQMainPanel>
				<jsdlwebspheremq:PropertyFileGroup>
			<jsdlwebspheremq:option>webspheremqServer4.properties</jsdlwebspheremq:option>
					</jsdlwebspheremq:PropertyFileGroup>
					<jsdlwebspheremq:PropertiesGroup>
						<jsdlwebspheremq:server>localhost</jsdlwebspheremq:server>
						<jsdlwebspheremq:port>1414</jsdlwebspheremq:port>
				<jsdlwebspheremq:user>agentuser</jsdlwebspheremq:user>
				<jsdlwebspheremq:password>
         aes}DrM1RhdBkMwl9YGD9QW21NgEMlG8eE4N0VciTpzI8d8=</jsdlwebspheremq:password>
				<jsdlwebspheremq:manager>QM_ADMINIB_897G50K</jsdlwebspheremq:manager>
					<jsdlwebspheremq:channel>S_ADMINIB_897G50K/jsdlwebspheremq:channel>
					</jsdlwebspheremq:PropertiesGroup>
					<jsdlwebspheremq:OperationGroup>
						<jsdlwebspheremq:PublishGroup>
			<jsdlwebspheremq:QueueOrTopicCombo>topic</jsdlwebspheremq:QueueOrTopicCombo>
					<jsdlwebspheremq:queueortopic>mytopic</jsdlwebspheremq:queueortopic>
						</jsdlwebspheremq:PublishGroup>
					</jsdlwebspheremq:OperationGroup>
				</jsdlwebspheremq:WebSphereMQMainPanel>
				<jsdlwebspheremq:WebSphereMQMessagePanel>
					<jsdlwebspheremq:MessageGroup>
						<jsdlwebspheremq:message>Hello World</jsdlwebspheremq:message>
					</jsdlwebspheremq:MessageGroup>
				</jsdlwebspheremq:WebSphereMQMessagePanel>
			</jsdlwebspheremq:WebSphereMQParameters>
		</jsdlwebspheremq:webspheremq>
  </jsdl:application>
</jsdl:jobDefinition>
 RECOVERY STOP

See also

From the Dynamic Workload Console you can perform the same task as described in

Creating job definitions.

For more information about how to create and edit scheduling objects, see

Designing your Workload.