3.1.5.1.3 Redirection and Error Handling

The protocol MUST perform the following steps:

  • If SRMPMessage.DestinationQueueFormatName begins with "MULTICAST" and SRMPMessage.DestinationQueueFormatName does not correspond to a queue in QueueManager.QueueCollection, the protocol MUST disregard the message and perform no further processing.

  • If SRMPMessage.DestinationQueueFormatName does not begin with "MULTICAST":

    • If the host part of the format name in SRMPMessage.DestinationQueueFormatName, as defined in [MS-MQMQ] section 2.1.2, does not represent the local machine:

      • If TransparentStoreAndForward is FALSE, the protocol MUST disregard the message and perform no further processing. Otherwise:

        • The protocol MUST generate an Open Queue ([MS-MQDMPR] section 3.1.7.1.5) event with the following arguments:

          • iFormatName := SRMPMessage.DestinationQueueFormatName

          • iRequiredAccess := QueueAccessType.SendAccess

          • iSharedMode := QueueShareMode.DenyNone

        • If the rStatus returned by the Open Queue event is not MQ_OK (0x00000000), the protocol MUST perform no further processing; otherwise, the protocol MUST generate an Enqueue Message To An Open Queue ([MS-MQDMPR] section 3.1.7.1.27) event with the following arguments:

          • iOpenQueueDescriptor := the rOpenQueueDescriptor returned by the Open Queue event

          • iMessage := SRMPMessage

        • The protocol MUST perform no further processing.

    • Let MessageDestination be a format name that represents the queue that is the final destination of the message, initialized to be the value of SRMPMessage.DestinationQueueFormatName.

    • The value of MessageDestination with the "DIRECT=" prefix removed MUST be checked against the URLs in the From attributes of the Redirection elements in the InboundRedirectionCollection (section 3.1.1.1.10.2). If a match is found, MessageDestination MUST be set to the value of the To attribute of the Redirection element that had the matching From attribute, prepended with "DIRECT=".

    • If the host part of the format name in MessageDestination, as defined in [MS-MQMQ] section 2.1.2, does not represent the local machine:

      • The protocol MUST generate an Open Queue ([MS-MQDMPR] section 3.1.7.1.5) event with the following arguments:

        • iFormatName := MessageDestination

        • iRequiredAccess := QueueAccessType.SendAccess

        • iSharedMode := QueueShareMode.DenyNone

      • If the rStatus returned by the Open Queue event is not MQ_OK (0x00000000), the protocol MUST perform no further processing; otherwise, the protocol MUST generate an Enqueue Message To An Open Queue ([MS-MQDMPR] section 3.1.7.1.27) event with the following arguments:

        • iOpenQueueDescriptor := the rOpenQueueDescriptor returned by the Open Queue event

        • iMessage := SRMPMessage

      • The protocol MUST perform no further processing.

    • If MessageDestination does not correspond to a queue in QueueManager.QueueCollection, the protocol MUST disregard the message and perform no further processing.

  • A stream message can be delivered only to a transactional queue, that is, Queue.Transactional = True. If the message contains the <stream> element and is addressed to a nontransactional queue in QueueManager.QueueCollection, the protocol MUST disregard the message and perform no further processing.

  • A nonstream message can be delivered only to a nontransactional queue, that is, Queue.Transactional = False. If the message does not contain the <stream> element and is addressed to a transactional queue in QueueManager.QueueCollection, the protocol MUST disregard the message and perform no further processing.

  • If the message is rejected for any of the previous reasons, the protocol MUST return the "HTTP 400 Bad Request" error message to the sender.