Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Symptoms

Consider the following scenario. In Microsoft BizTalk Server 2006 and 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.

↑ Back to the top


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.

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

The SendMSMQMessage sample application that is located in the BizTalk Server 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 in BizTalk Server 2004, 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.

↑ Back to the top


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:

↑ Back to the top


Keywords: kbbiztalk2004-2006swept, kbbtsadapters, kbtshoot, kbinfo, kbprb, KB897293

↑ Back to the top

Article Info
Article ID : 897293
Revision : 4
Created on : 3/15/2007
Published on : 3/15/2007
Exists online : False
Views : 348