Why does the CompletionMessage message appear when the service starts?

I created an nservice application.

the application listens on queue A, does some processing if there is a message from queue A. then send another message to queue B.

The following is a way to start the nservice bus

_bus = NServiceBus.Configure.With() .Log4Net() .DefaultBuilder() .XmlSerializer() .MsmqTransport() .IsTransactional(true) .PurgeOnStartup(false) .UnicastBus() .ImpersonateSender(false) .LoadMessageHandlers() .CreateBus() .Start(); 

And here is the configuration:

 <MsmqTransportConfig InputQueue="DemoQueueA" ErrorQueue="DemoQueueAError" NumberOfWorkerThreads="1" MaxRetries="5" /> <UnicastBusConfig DistributorControlAddress="" DistributorDataAddress=""> <MessageEndpointMappings> <add Messages="Demo.Messages" Endpoint="DemoQueueB"/> </MessageEndpointMappings> </UnicastBusConfig> 

When I run my application. there is always a message in "DemoQueueB"

 <?xml version="1.0"?> <Messages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.net/NServiceBus.Unicast.Transport"> <CompletionMessage> <ErrorCode>0</ErrorCode> </CompletionMessage> </Messages> 

So is something wrong with my application? coz I did not send anything to QueueB. This is an empty application.

+4
source share
1 answer

CompletionMessage is one of the internal message types that NServiceBus uses to manage itself. NServiceBus uses it to initialize, to pass return codes through the IBus.Return () method, and to confirm subscription and unsubscribe requests.

Generally, you should simply completely ignore these messages.

+6
source

All Articles