Note that there are some explanatory texts on larger screens.

plurals
  1. POReceiving the Same MSMQ Message Twice?
    primarykey
    data
    text
    <p>I have an MSMQ-based system with three layers that communicate with each other. For the sake of simplicity, I'll refer to them as Layer 1, 2, and 3. They sit like this:</p> <pre><code>Layer 1 &lt;-&gt; Layer 2 &lt;-&gt; Layer 3 </code></pre> <p>So Layer 1 talks only to Layer 2, Layer 3 talks only to Layer 2, and Layer 2 talks to both others. I have four queues for this,</p> <pre><code>Layer1_in Layer1_out Layer3_out Layer3_in </code></pre> <p>And the layers communicate over this infrastructure:</p> <pre><code>Layer 1 -&gt; Layer1_out -&gt; Layer 2 Layer 1 &lt;- Layer1_in &lt;- Layer 2 Layer 3 -&gt; Layer3_out -&gt; Layer 2 Layer 3 &lt;- Layer3_in &lt;- Layer 2 </code></pre> <p>(sorry if this is more exhaustive than necessary)</p> <p>Anyhow, a message gets passed from Layer 1 to Layer 2, some processing takes place, then another (related) message is sent to Layer 3, and vice versa. The issue I'm having is that occasionally I have two messages sent from Layer 1 to Layer 2, but instead of receiving both messages in order it's receiving the first message twice. I'm using <code>BeginReceive</code> on <code>Layer1_out</code> to asynchronously receive the message. When that completes I process the received message and call <code>BeginReceive</code> again to get the next message. </p> <p>To track this down I implemented a message counter on the sending side and I write it to a text file. I'm using the <code>Extension</code> property to store a string representation of this message number so that I can then retrieve the message number on the processing side. When I recieve a message, I take this number and write it to a different file. This SHOULD produce two files that have the same contents, but instead I'll see things like</p> <pre><code>00000000000000000214 00000000000000000215 00000000000000000215 &lt;- this is bad! 00000000000000000217 00000000000000000218 00000000000000000219 </code></pre> <p>In the receipt log, indicating that message 215 was processed twice and 216 didn't come through. For my purposes it doesn't affect anything for me to process the same message twice (hence why this has gone unnoticed for some time), but missing a message altogether is a big problem.</p> <p>Any thoughts?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload