Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try moving <code>UnicastBus()</code> to the end of your call, like this:</p> <pre><code> Configure.With() .DefaultBuilder() .XmlSerializer() .AzureServiceBusMessageQueue() .IsTransactional(true) .MessageForwardingInCaseOfFault() .UseInMemoryTimeoutPersister() .InMemorySubscriptionStorage() .UnicastBus(); // &lt;- Here </code></pre> <p>And about those third parties posting messages to the queue. Keep in mind that they need to respect <a href="https://github.com/NServiceBus/NServiceBus/blob/master/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AzureServiceBusMessageQueue.cs" rel="nofollow">how NServiceBus handles serialization/deserialization</a>. Here is how this is done in NServiceBus (the most important part is that the BrokeredMessage is initialized with a raw message, the result of a serialziation using the BinaryFormatter):</p> <pre><code> private void Send(Byte[] rawMessage, QueueClient sender) { var numRetries = 0; var sent = false; while(!sent) { try { var brokeredMessage = new BrokeredMessage(rawMessage); sender.Send(brokeredMessage); sent = true; } // back off when we're being throttled catch (ServerBusyException) { numRetries++; if (numRetries &gt;= MaxDeliveryCount) throw; Thread.Sleep(TimeSpan.FromSeconds(numRetries * DefaultBackoffTimeInSeconds)); } } } private static byte[] SerializeMessage(TransportMessage message) { if (message.Headers == null) message.Headers = new Dictionary&lt;string, string&gt;(); if (!message.Headers.ContainsKey(Idforcorrelation)) message.Headers.Add(Idforcorrelation, null); if (String.IsNullOrEmpty(message.Headers[Idforcorrelation])) message.Headers[Idforcorrelation] = message.IdForCorrelation; using (var stream = new MemoryStream()) { var formatter = new BinaryFormatter(); formatter.Serialize(stream, message); return stream.ToArray(); } } </code></pre> <p>If you want NServiceBus to correctly deserialize the message, make sure your thierd parties serialize it correctly.</p>
 

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