3.1.7.1.16 Move Message
This event MUST be generated with the following arguments:
iMessagePos: A reference to a MessagePosition (section 3.1.1.11) ADM element instance that contains the message that is moved to another queue.
iTargetQueue: A reference to the target Queue (section 3.1.1.2) ADM element instance for iMessage.
iTransaction (Optional): A reference to a Transaction (section 3.1.1.14) ADM element instance that provides the unit of work for the move operation.
The iTransaction argument MUST NOT be supplied if iTargetQueue.QueueType is System.
Return Value:
None.
To process this event, the queue manager marks a message as deleted from the source queue and adds it to the destination queue. Alternate implementations can explicitly delete the message from the source queue as long as their external behavior is consistent with the behavior described in this document.
The queue manager MUST perform the following actions to process this event:
If the iTransaction argument is not supplied:
Set iMessagePos.State to Deleted.
Create a new MessagePosition ADM element instance in iTargetQueue, referred to as newMessagePos, and set newMessagePos.MessageReference to iMessagePos.MessageReference, newMessagePos.State to Available, and newMessagePos.QueueReference to iTargetQueue. The queue manager MUST create this new MessagePosition ADM element instance in iTargetQueue, according to the rules specified for the MessagePositionList ADM attribute of the Queue ADM element.
If iTargetQueue.QueueType is not System then:
Generate a Message Position Available (section 3.1.7.2.2) event with the following arguments:
iQueue := iTargetQueue
iPosition := newMessagePos
Else:
Set iMessagePos.State to Locked.
Create a new TransactionalOperation (section 3.1.1.13) ADM element instance with the following attribute values:
OperationType := Move
MessagePositionReference := iMessagePos
TargetQueue := iTargetQueue
Add the new TransactionalOperation ADM element instance to the end of iTransaction.TransactionalOperationCollection.