none
Messages lost while writing from web server to a remote MSMQ RRS feed

  • Question

  • Scenario:
    Messages LOST intermittently while Web Service hoted in the IIS Layer, writing to a MSMQ remote private queue

    Detailed Description:
    One of our application posts messages to MSMQ layer, from which BizTalk receives through an BizTalk MSMQ Adapter. While an external application post the XML messages to our Web Server, a web service picks and drops into an outgoing queue, which inturn gets transferred to the remote MSMQ.

    Observation:
    I'm observing a message loss intermittantly, where the message has not reached the remote queue. I've observed the Web Server Hits happened during this scenario, which clearly state that the XML POST has happened at the web server, but messages lost in the transit to the remote queue.

    There is no event log entry around this behaviour.

    Specification around this solution:
    MSMQ is a transactional queue, and the routine in the web service which write to the MSMQ is as below:

    We have done an internal code analysis as below:

    To send a message to the Queue the MessageQueueTransactionType.Single enumeration is used which uses the internal trasaction mechanism to write the message into the queue. The usage of MessageQueueTransaction class would be more advantageous where it enables Message Queuing transaction technique where the sending application can explicitly commit the message to its outgoing queue ensuring confirmed delivery and the message later gets delivered to destination queue. It also enables to send multiple messages within a single transaction.



    Please provide your expert comments around this.
    Monday, July 20, 2009 5:38 AM

Answers

  • On a distributed network the message could get lost in several different places. I would check the event log for msmq errors on both the server where the message was sent and the one with the destination queue. You may want to use the event log filters to find the error messages better.

    You might be interested in using the WCF-NetMsmq binding as a way to use a web service to send to MSMQ. This would give you some better logging and tracing opportunities.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, July 23, 2009 4:36 AM
    Moderator

All replies

  • Just to confirm, have you been able to get messages to the remote queue at all or just sometimes?

    It sounds like the message loss is occuring prior to BizTalk receiving the message. The loss is more of a delivery problem to the remote queue. What OS are you using to host the queue? If you are on Vista or Windows Server 2008 you could check the poison queue to see if any of the lost messages had been moved there due to delivery failures. 

    Thanks, 


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Monday, July 20, 2009 3:49 PM
    Moderator
  • Ben
    Thanks for the response.

    You are absolutely right, as the messages are lost prior to BizTalk getting a chance to receive the message. OS is Windows 2003 SP2. Is there any option to see the lost messages in this version?

    This is also experienced intermittently.

    Thanks,
    Wednesday, July 22, 2009 4:00 AM
  • On a distributed network the message could get lost in several different places. I would check the event log for msmq errors on both the server where the message was sent and the one with the destination queue. You may want to use the event log filters to find the error messages better.

    You might be interested in using the WCF-NetMsmq binding as a way to use a web service to send to MSMQ. This would give you some better logging and tracing opportunities.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, July 23, 2009 4:36 AM
    Moderator
  • Although this is an old question, i just found out some other explanations for messages being lost while sending them to the remote queue:

     

    1) The TimeToReachQueue Property is default 0

    When using a Dynamic Send port this is interpreted as 0 sec, increase this value and you will be ok.

    From MSDN: "If the interval specified by the TimeToReachQueue property expires before the message reaches its destination, Message Queuing discards the message in one of two ways. If the message's UseDeadLetterQueue property is true, the message is sent to the dead-letter queue. If UseDeadLetterQueue is false, the message is ignored "

    http://msdn.microsoft.com/en-us/library/system.messaging.message.timetoreachqueue.aspx
    http://www.44342.com/BizTalk-f20-t14495-p1.htm

     

    2) The Authenticated property on the remote Queue is checked

    In this case, the Logon information on the MSMQ Adapter properties must be set to use an Active directory account. 

     

     

    HTH

    Regards,

    Sander Nefs - MCTS BizTalk Server
    blog: http://snefs.blogspot.com

    If this answer your question, please mark it as answered.


     

     


    Sander Nefs

    Friday, May 27, 2011 8:17 AM