A message is not suspended in the suspended queue if validation is unsuccessful when you send a message to a MSMQT receive location in BizTalk Server 2004 (897293)



The information in this article applies to:

  • Microsoft BizTalk Server 2004 Enterprise Edition
  • Microsoft BizTalk Server 2004 Standard Edition
  • Microsoft BizTalk Server 2004 Developer Edition
  • Microsoft BizTalk Server 2004 Partner Edition

SYMPTOMS

Consider the following scenario. In Microsoft BizTalk Server 2004, you send an XML message to a BizTalk Message Queuing Adapter (MSMQT) receive location. If the XML validation is unsuccessful in the receive pipeline, the message is not suspended in the suspended queue. Additionally, when you try to locate the message, you cannot find the message in any message queue of the sending computer.

CAUSE

This behavior occurs because both the transport and transform functions are performed together in the MSMQT receive location. Therefore, any receive pipeline failure is treated the same as a transport failure. The effect of this behavior is that the MSMQT does not suspend the incoming message that was not accepted by BizTalk Server.

When the XML validation is unsuccessful, a negative acknowledgement (NACK) is sent out to the sending Microsoft Message Queuing computer. If the client application that sent the message was configured to use the system dead letter queue of the client computer, the message may be located in this dead letter queue.

Note You can also enable Message Queuing journaling in the client application to record all messages sent.

STATUS

This behavior is by design.

MORE INFORMATION

The SendMSMQMessage sample application that is located in the BizTalk Server 2004 SDK samples folder is not configured to use any one of the system queues to receive a NACK. To make the SendMSMQMessage application use journaling and the dead letter queue, replace the code behind the Send exact button click event with the following code:
try 
{
MessageQueueTransaction myTransaction = new MessageQueueTransaction();
MessageQueue mq = new MessageQueue(textBoxAddr.Text);
System.Messaging.Message msg = new System.Messaging.Message();
msg.Label = "TestMessageLabel";
StreamWriter wr = new StreamWriter(msg.BodyStream,System.Text.Encoding.Unicode);
wr.Write(textBoxBody.Text);
wr.Flush();
myTransaction.Begin();
msg.UseJournalQueue = true;
msg.UseDeadLetterQueue = true;
mq.Send(msg,myTransaction); 
myTransaction.Commit();
textError.Text = "Success."; 
} 
catch (Exception ex)
{ 
textError.Text = ex.ToString();
}
After you replace the code, when you click the Send exact button to send a message to your MSMQT receive function and the message fails validation, a NACK is sent back to the originating Message Queuing server and your message is stored under the system dead letter queue. Additionally, if the message validation was successful, a positive acknowledgement (ACK) is sent back to the originating Message Queuing server, and your message is now viewable under the system journal queue.

Note If you require different behavior, you may want to use the Microsoft BizTalk Server 2004 Adapter for Message Queuing 2.0. For example, you may want to decouple the transport failures from the transform failure and to see the failed message as suspended within BizTalk Server.

REFERENCES

For more information about how to set up and how to use recoverable messages, transactions, and acknowledgements, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:5/3/2005
Keywords:kbBTSAdapters kbtshoot kbinfo kbprb KB897293 kbAudDeveloper kbAudITPRO