Public Attributes | |
Channel | |
Channel Definition Options: Channel Name. More... | |
CharSetId | |
Message Descriptor Options: Character Set Identifier. More... | |
Connection | |
Channel Definition Options: Connection name. More... | |
Context | |
Flag indicating use of message context. More... | |
Password | |
Channel Definition Options: Password (if any) More... | |
PutApplType | |
Message Descriptor Options: Put application type. More... | |
QMBehavior | |
Flag indicating Queue Manager behavior. More... | |
QMgr | |
Queue Manager name. More... | |
QName | |
Queue name. More... | |
SSLCipherSpec | |
Channel Definition Options: SSL Cipher Spec. More... | |
Syncpoint | |
Flag indicating use of SYNCPOINT. More... | |
Transport | |
Channel Definition Options: Transport type. More... | |
Username | |
Channel Definition Options: Username (if any) More... | |
Static Public Attributes | |
ApplIdentityData = None | |
Message Descriptor Options: Application Identity. More... | |
CorrelationId = None | |
Message Descriptor Options: Correlation Id. More... | |
MessageId = None | |
Message Descriptor Options: Message Id. More... | |
ReplyQMgrName = None | |
Message Descriptor Options: Reply Q Manager name. More... | |
ReplyQName = None | |
Message Descriptor Options: Reply Q name. More... | |
![]() | |
CAPTION = None | |
Optional name used by the Form Wizard for a class when generating forms. More... | |
JAVATYPE = None | |
The Java type to be used when exported. | |
PROPERTYVALIDATION = None | |
This parameter controls the default validation behavior for the object. More... | |
Private Member Functions | |
_.Library.Boolean | ApplIdentityData (_.Library.String Value) |
The ApplIdentityData method returns the Application Identity Data for the last message read. More... | |
_.Library.Boolean | Backout () |
Backout backs out changes to the queue. More... | |
_.Library.Boolean | CharSet (_.Library.Integer Value) |
The CharSet method returns the current value of the. More... | |
_.Library.Boolean | Commit () |
Commit commits changes to the queue. More... | |
_.Library.Boolean | Connect () |
Connect creates a connection to a queue manager and opens the queue object. More... | |
_.Library.Boolean | CorId (_.Library.String Value) |
The CorId method returns the Correlation Id for the last message read. More... | |
_.Library.Boolean | ErrLog (_.Library.String log) |
The ErrLog method creates an error log. More... | |
_.Library.Integer | GetLastError () |
GetLastError returns the last error or reason code returned from MQ. | |
_.Library.Boolean | Init (_.Library.String QName, _.Library.String QMgr, _.Library.String QChannel, _.Library.String ErrorFile) |
Init creates a connection to a queue. More... | |
_.Library.Boolean | MsgId (_.Library.String Value) |
The MsgId method returns the Message Id for the last message read. More... | |
_.Library.Boolean | PutApplType (_.Library.Integer Value) |
The PutApplType method returns the Put Application Type for the last message read. More... | |
_.Library.Boolean | ReplyQMgrName (_.Library.String Value) |
The ReplyQMgrName method returns the Reply Queue Manager Name for the last message read. More... | |
_.Library.Boolean | ReplyQName (_.Library.String Value) |
The ReplyQName method returns the Reply Queue Name for the last message read. More... | |
_.Library.Boolean | SetCharSet (_.Library.Integer Value) |
The SetCharSet method sets the Coded Character Set Id. More... | |
_.Library.Boolean | Syncpoint (_.Library.Integer Value) |
The Syncpoint method returns the current syncpoint status for the connection. More... | |
Additional Inherited Members | |
![]() | |
_.Library.Status | OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount) |
This callback method is invoked when the current object is added to the SaveSet,. More... | |
_.Library.Status | OnClose () |
This callback method is invoked by the <METHOD>Close</METHOD> method to. More... | |
_.Library.Status | OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned) |
This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More... | |
_.Library.Status | OnNew () |
This callback method is invoked by the <METHOD>New</METHOD> method to. More... | |
_.Library.Status | OnValidateObject () |
This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More... | |
For information on using the API provided by this class, see Using MQ.
The Net.MQ class provides an interface to the IBM WebSphere MQ Series messaging product. Two classes are provided: <class>Net.MQSend</class> for sending messages to a queue, and <class>Net.MQRecv</class> for picking up messages that have been queued.
Usage
An MQ object is created when an instance of an MQ class is created via New. Following creation, the class can be assigned an error log file, and connected to an MQ Server.
The Init() method is a simple way to perform both these functions.
For advanced applications, these steps can be performed via separate method calls.
To establish an error log file for the class, call ErrLog().
A connection is established by calling the Connect() method. The connection is maintained until you deallocate the instance. The instance must be successfully connected before it can be used for message queuing.
Use MQSend.Put() to send messages to a queue. Use MQRecv.Get() to read messages from a queue.
All methods return 1 for success, 0 for failure. In case of a failure, the actual MQ error code is available via the method GetLastError().
Charcter Set Translation
CharSet(.ccs) Retrieves the Coded Character Set identifier. This value may be altered by the message system after an unsuccessful attempt to convert data in MQGet.
SetCharSet(id) Sets the Coded Character Set identifier. Incoming messages will be converted to this character set. Outgoing message's character set encoding is identified to the message queue with this value.
For output (MQSend.Put()), the Coded Character Set Id describes to the system the char set used for the message. If not set, the MQ system assumes the default character set for the MQ client.
For input (MQRecv.Get()), the Coded Character Set Id indicates to the MQ client how the message should be converted. The conversion is done automatically during message reciept on the client.
Thus one may send messages in any encoding (notifying the system what the encoding used is), and receive messages converting from one encoding to another.
Example:
To convert a message encoded in EBCDIC (Character Coded Set Id 1047, indicating IBM-1047 coding), a user on a Windows system may wish to convert using code 437 (the default on Windows systems). Then the following will convert the EBCDIC message to ascii on the windows system:
Do mq.SetCharSet(437) ;437 English ascii code on Windows
Do mq.Get(.msg) ;converts the message to 437 code
MQ Documentation
Consult the IBM WebSphere MQ website for further documentation.
|
private |
The ApplIdentityData method returns the Application Identity Data for the last message read.
|
private |
Backout backs out changes to the queue.
Used in conjunction with the
syncpoint option. If the syncpoint option is set, then when sending, no messages are visible on the queue until commit. If backout is called, all the messages sent since the last commit are removed from the queue. When receiving, the messages are not removed from the queue until commit is issued. If backout is called, the messages are restored to the queue and available to users.
Backout returns 0 on failure, 1 on success.
|
private |
The CharSet method returns the current value of the.
Coded Character Set Id used for message conversion. The CCSId may also be set to the message's Character Set if conversion was not possible.
|
private |
Commit commits changes to the queue.
Used in conjunction with the
syncpoint option. If the syncpoint option is set, then when sending, no messages are visible on the queue until commit. When receiving, the messages are not removed from the queue until commit is issued.
Commit returns 0 on failure, 1 on success.
|
private |
Connect creates a connection to a queue manager and opens the queue object.
A connection
and open MQ object (queue, topic, subscription) is required before messages can be sent or received.
User must first set the standard MQSeries initialization arguments
QName: Host Queue Name (Required)
QMgr: Host Queue Manager name. Passing "" connects to the default queue manager. (Optional)
Channel: Host Channel name (Optional)
Transport: Transport type (TCP, LU62, NETBIOS, SPX) (Optional)
Connection: Connection spec, e.g., "127.0.0.1(1401)" (Optional)
See IBM MQ documentation on establishing defaults, and MQ authentication.
|
private |
The CorId method returns the Correlation Id for the last message read.
|
private |
The ErrLog method creates an error log.
to be used for errors on this object.
|
private |
Init creates a connection to a queue.
A connection
is required before messages can be sent or received. Use the following standard MQSeries initialization arguments:
QName: Host Queue name (Required)
QMgr: Host Queue Manager name. Passing "" connects to the default queue manager. (Optional)
QChannel: Host Channel specification, in form <channel>/TCP/<hostname>(<port>) If not set, MQ connects to the default Channel. (Optional)
ErrorFile: For logging, specify a file name to store MQ system returned messages. (Optional)
Init returns 0 on failure, 1 on success.
|
private |
The MsgId method returns the Message Id for the last message read.
|
private |
The PutApplType method returns the Put Application Type for the last message read.
|
private |
The ReplyQMgrName method returns the Reply Queue Manager Name for the last message read.
|
private |
The ReplyQName method returns the Reply Queue Name for the last message read.
|
private |
The SetCharSet method sets the Coded Character Set Id.
to be used for message conversion.
|
private |
The Syncpoint method returns the current syncpoint status for the connection.
|
static |
Message Descriptor Options: Application Identity.
|
static |
Message Descriptor Options: Correlation Id.
|
static |
Message Descriptor Options: Message Id.
|
static |
Message Descriptor Options: Reply Q Manager name.
|
static |
Message Descriptor Options: Reply Q name.
Channel |
Channel Definition Options: Channel Name.
CharSetId |
Message Descriptor Options: Character Set Identifier.
Connection |
Channel Definition Options: Connection name.
Context |
Flag indicating use of message context.
0 - DEFAULT, 1 - IDENTITY, 2 - ALL
Password |
Channel Definition Options: Password (if any)
PutApplType |
Message Descriptor Options: Put application type.
QMBehavior |
Flag indicating Queue Manager behavior.
0 - commit on disconnect (DEFAULT), 1 - backout on disconnect
QMgr |
Queue Manager name.
QName |
Queue name.
SSLCipherSpec |
Channel Definition Options: SSL Cipher Spec.
Syncpoint |
Flag indicating use of SYNCPOINT.
Transport |
Channel Definition Options: Transport type.
Username |
Channel Definition Options: Username (if any)