3.1.7.1.27 Enqueue Message To An Open Queue

This event MUST be generated with the following arguments:

  • iOpenQueueDescriptor: The OpenQueueDescriptor (section 3.1.1.16) ADM element instance that references the Queue (section 3.1.1.2) ADM element instance or instances to which the Message (section 3.1.1.12) ADM element instance will be added.

  • iMessage: A reference to a Message (section 3.1.1.12) ADM element instance that will be added to the Queue (section 3.1.1.2) ADM element instance referenced by iOpenQueueDescriptor.QueueReference.

  • iTransaction (Optional): A reference to a Transaction (section 3.1.1.14) ADM element instance that provides the unit of work for the enqueue operation.

Return Value:

  • rStatus: A status code that can be one of the following:

    • no error (0)

    • queue quota would be exceeded (1)

    • queue manager quota would be exceeded (2)

    • message timed out in transit (3)

The queue manager MUST perform the following actions to process this event:

  • If iOpenQueueDescriptor.Multiple is FALSE:

    • Generate an Enqueue Message (section 3.1.7.1.9) event with the following arguments:

      • iQueue := iOpenQueueDescriptor.QueueReference

      • iMessage := iMessage

      • iTransaction := iTransaction (if supplied)

    • Set rStatus to the rStatus returned by the Enqueue Message event.

    • Take no further action.

  • Set iMessage.DestinationMultiQueueFormatName to iOpenQueueDescriptor.FormatName.

  • For each OpenQueueDescriptor ADM element instance in iOpenQueueDescriptor.OpenQueueDescriptorCollection, referred to as SingleOpenQueue:

    • Let MessageCopy be a Message ADM element instance, initialized to be a copy of iMessage.

    • Set MessageCopy.DestinationFormatName to SingleOpenQueue.FormatName.

    • Generate an Enqueue Message event with the following arguments:

      • iQueue := SingleOpenQueue

      • iMessage := MessageCopy

      • iTransaction := iTransaction (if supplied)

    • If the rStatus returned by the Enqueue Message event is not MQ_OK (0x00000000), set rStatus to the returned value, and take no further action.

  • Set rStatus to zero.