public override void Close()
Overrides MQManagedObject.Close.
public void Get(MQMessage message, MQGetMessageOptions getMessageOptions, int MaxMsgSize)
Throws MQException.
Retrieves a message from the queue, up to a maximum specified message size.
This method takes an MQMessage object as a parameter. It uses some of the fields in the object as input parameters, in particular the messageId and correlationId, so it is important to ensure that these are set as required.
If the get fails, the MQMessage object is unchanged. If it succeeds, the message descriptor (member variables) and message data portions of the MQMessage are completely replaced with the message descriptor and message data from the incoming message.
All calls to WebSphere MQ from a given MQQueueManager are synchronous. Therefore, if you perform a get with wait, all other threads using the same MQQueueManager are blocked from making further WebSphere MQ calls until the get completes. If you need multiple threads to access WebSphere MQ simultaneously, each thread must create its own MQQueueManager object.
Parameters
Using option MQC.MQGMO_CONVERT might result in an exception with reason code MQException.MQRC_CONVERTED_STRING_TOO_BIG when converting from single byte character codes to double byte codes. In this case, the message is copied into the buffer but remains encoded using its original character set.
Throws MQException if the get fails.
public void Get(MQMessage message, MQGetMessageOptions getMessageOptions)
Throws MQException.
Retrieves a message from the queue, regardless of the size of the message. For large messages, the get method might have to issue two calls to WebSphere MQ on your behalf, one to establish the required buffer size and one to get the message data itself.
This method takes an MQMessage object as a parameter. It uses some of the fields in the object as input parameters, in particular the messageId and correlationId, so it is important to ensure that these are set as required.
If the get fails, the MQMessage object is unchanged. If it succeeds, the message descriptor (member variables) and message data portions of the MQMessage are completely replaced with the message descriptor and message data from the incoming message.
All calls to WebSphere MQ from a given MQQueueManager are synchronous. Therefore, if you perform a get with wait, all other threads using the same MQQueueManager are blocked from making further WebSphere MQ calls until the get completes. If you need multiple threads to access WebSphere MQ simultaneously, each thread must create its own MQQueueManager object.
Parameters
Throws MQException if the get fails.
public void Get(MQMessage message)
A simplified version of the Get method previously described.
Parameters
This method uses a default instance of MQGetMessageOptions to do the get. The message option used is MQGMO_NOWAIT.
public void Put(MQMessage message, MQPutMessageOptions putMessageOptions)
Throws MQException.
Places a message onto the queue.
This method takes an MQMessage object as a parameter. The message descriptor properties of this object can be altered as a result of this method. The values that they have immediately after the completion of this method are the values that were put onto the WebSphere MQ queue.
Modifications to the MQMessage object after the put has completed do not affect the actual message on the WebSphere MQ queue.
A Put updates the messageId and correlationId. Consider this when making further calls to Put/Get using the same MQMessage object. Also, calling Put does not clear the message data, so:
msg.WriteString("a"); q.Put(msg,pmo); msg.WriteString("b"); q.Put(msg,pmo);
puts two messages. The first contains a and the second ab.
Parameters
Throws MQException if the put fails.
public void Put(MQMessage message)
A simplified version of the Put method previously described.
Parameters
This method uses a default instance of MQPutMessageOptions to do the put.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csqzav0461 |