Runtime components : Service components : Communication services : MQ Connector : Reference
  
Reference
See also
MQ Connector event notification
MQ Connector exception
MQ Connector external definitions
MQ Connector
MQ Connector event notification
MQConnection signals the following events, all of which are handled by the ConnectionManager class:
message, when data arrives. The event contains a hash table with the following two elements:
message: The MQMessage received
queue: The name of the queue that contains the received message, including the deadletter queue
opened, when the connection is opened
closed, when the connection is closed
errorReceived, when an error is produced in the asynchronous receive process
See Customizing event management for information on the default behavior of the handler for these events.
See also
Reference
MQ Connector exception
The MQ Connector service throws the following exception:
MQException
MQException due to mq native services.
Action: Check actions for com.ibm.mq.MQException.
See also
Reference
MQ Connector external definitions
The MQ Connector service is defined by the following data in the toolkit services definition file:
MQConnection tag attributes
id
Service name
QMgrName
Name of the queue manager. Mandatory.
AliasQMgrNameSend
Name of the queue manager on which the send queue is defined. This queue manager is different from QMgrName above.
deadLetterQ
Name of the deadletter queue. Optional.
sendToQ
Name of the send queue. Mandatory for static queues. If the MQ Connector is using dynamic queues to send messages, this tag must not have a value.
replyToQ
Name of the reply queue. Mandatory for static queues. If the MQ Connector is using dynamic queues to receive messages, this tag must not have a value.
putMessageOptions
Options that control the behavior of sendToQ. The default is MQPMO_NEW_MSG_ID|.
getMessageOptions
Options that control the behavior of replyToQ. The default is
MQGMO_WAIT|
MQGMO_FAIL_IF_QUIESCING|
MQGMO_COMPLETE_MSG.
sendToQOpenOptions
Options that control the opening of the send queue. The default is MQOO_OUTPUT.
replyToQOpenOptions
Options that control the opening of the reply queue. The default is MQOO_INPUT_AS_Q_DEF
persistence
Message persistence in the queue. Optional. The default is MQPER_PERSISTENCE_AS_Q_DEF
charSet
Character set relating to application message data. Optional. The default is MQCCSI_Q_MGR
messageType
Message type. Optional. The default is MQMT_DATAGRAM
messageOrCorrelation
Message search criteria. Following are the possible values:
message. The message ID in the reply message has to match the request messageId.
correlation. The correlation ID in the reply message has to match the request messageId. This is the default value.
encoding
Message numeric data representation. Optional. The default is MQENC_NATIVE
format
Format name employed by the sender to inform the receiver of the message format. Optional. The default is MQFMT_NONE
userId
Name of the message originator. Optional.
replyToQmgr
Name of the destination QueueManager for reply messages. Optional.
applicationName
Name of the application employed to send messages. Optional.
timeout
Timeout employed in the receive method. Optional.
serverOrClient
Whether the service is to work with Java Bindings or with Client for Java. Following are the possible values:
server (default)
client
synchronousMode
Whether the service is to work in synchronous mode. Following are the possible values:
enabled
disabled (default)
hostName
Name of the host with which the client is to connect when the service works as MQClient. This attribute is mandatory in this case.
channel
Name of the channel that the client is to use when the service works as MQClient. This attribute is mandatory in this case.
port
Port number for the client to use when the service works as MQClient. The default value is 1414. This attribute is mandatory if hostName or channel has not been specified.
expiry
How long WebSphere MQ retains (in tenths of a second) an unretrieved message before discarding it. The default value is MQC.MQEI_UNLIMITED.
automaticConnection
Establishment
Whether the connection is to be established automatically. Following are the possible values:
enabled
disabled (default)
sendModelQ
Name of the send model queue. Mandatory for dynamic queues.
sendDynamicQTemplate
Name of the dynamic send queue. This replaces the default name.
replyModelQ
Name of the reply model queue. Mandatory for dynamic queues.
replyDynamicQTemplate
Name of the dynamic send queue. This replaces the default name.
sendToQType
Whether a model queue is used to define the send queue. For dynamic queues, the value is "model"
replyToQType
Whether a model queue is used to define the reply queue. For dynamic queues, the value is "model"
Note The following parameter values can be specified with either an integer value or the corresponding constant defined in the com.ibm.mq.MQC interface:
putMessageOptions
getMessageOptions
replyToQOpenOptions
sendToQOpenOptions
persistence
charSet
messageType
encoding
The "format" parameter can be specified using a string value or its equivalent constant defined in the com.ibm.mq.MQC interface.
Examples
The following example defines a connection using static queues:
<MQConnection id="CNV1" QMgrName="QMS" sendToQ="QS1" replyToQ="QS2"
putMessageOptions="4" getMessageOptions="17" synchronousMode="disabled"
serverOrClient="server" replyToQOpenOptions="MQOO_OUTPUT|MQOO_INPUT_AS_Q_DEF"
persistence="MQPER_PERSISTENT" charSet="MQCCSI_DEFAULT" messageType="MQMT_REQUEST"
encoding="MQENC_NATIVE" format="MQFMT_STRING" timeout="100" />
The following examples define connections using dynamic queues:
<MQConnection id="MQC" QMgrName="QMS" replyToQType="model" sendToQ="QS1"
replyDynamicQTemplate="DYN_Q_*" replyModelQ="RECEIVE.MODEL.QUEUE.PER"
sendModelQName="QS1" replyToQ="QS2" synchronousMode="enabled"
serverOrClient="client" hostName="dsccrisc1" channel="CLIENT.TO.SERVER"
port="1414" automaticConnectionEstablishment="enabled"/>
<MQConnection id="MQC" QMgrName="QMS" sendToQType="model" replyToQ="QS1"
sendDynamicQTemplate="DYN1_Q_*" sendModelQ="SEND.MODEL.QUEUE.PER" sendToQ="QS1"
replyModelQ="RECEIVE.MODEL.QUEUE.PER" synchronousMode="enabled"
serverOrClient="server" automaticConnectionEstablishment="disabled" >
See also
Reference