I have the following Setup:
-
One service called
CoreHostshould receive aExecuteWorkflowByAttributeCommandwhich isBus.Sendto it and publishWorkflowByAttributeExecutedafterwards. -
One “client” which uses
Bus.Sendto execute the command and is subscribed to theWorkflowByAttributeExecutedmessage.
The Handler looks like this:
public void Handle(WorkflowByAttributeCommand message)
{
MessageLifetimeLogger.Info("Received WorkflowByAttribute Command", ...);
var log = _executor.ExecuteWithLog(message.Attribute,
message.SerializedWorkItem,
message.Id);
Bus.Publish(new WorkflowByAttributeExecuted(message.Id, log));
MessageLifetimeLogger.Info("Completed WorkflowByAttribute Command", ...);
}
On my development machine it runs fine but on our test system the same does not.
The command is received and the handler is obviously executed (the log contains the appropriate entries) but no message is published.
What surprises me is that the log looks completely different on both machines.
The working machines log contains
Received message MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeCommand, MHP.Domain.Common.Core, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null with ID 6e15d4f7-7aa7-4be3-bd80-e70497bc5051\66585 from sender TestServerQueue@PC-SB-11
Activating: WorkflowByAttributeHandler
// some log entries generated by the Handle method
Sending message MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeExecuted, MHP.Domain.Common.Core, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null with ID 6e15d4f7-7aa7-4be3-bd80-e70497bc5051\66587 to destination TestServerQueue@PC-SB-11.
WorkflowByAttributeHandler Done.
whereby the not working machines log contains only
Received message MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeCommand, MHP.Domain.Common.Core, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null with ID 6e15d4f7-7aa7-4be3-bd80-e70497bc5051\66585 from sender TestServerQueue@PC-SB-11
// some log entries generated by the Handle method
However all message types seem to be registered successfully:
Subscribing TestServerQueue@VM-SCRUM-VLOG to message type MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeExecuted, MHP.Domain.Common.Core, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null |
Subscribing TestServerQueue@VM-SCRUM-VLOG to message type MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeCommand, MHP.Domain.Common.Core, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null |
The app.config of the server looks like
<MsmqTransportConfig
InputQueue="CoreHostQueue"
ErrorQueue="ErrorQueue"
NumberOfWorkerThreads="1"
MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings>
</MessageEndpointMappings>
</UnicastBusConfig>
The other one contains the message mappings
<MsmqTransportConfig
InputQueue="TestServerQueue"
ErrorQueue="ErrorQueue"
NumberOfWorkerThreads="2"
MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeCommand, MHP.Domain.Common.Core" Endpoint="CoreHostQueue"/>
<add Messages="MHP.Domain.Common.Core.Messaging.WorkflowByAttribute.WorkflowByAttributeExecuted, MHP.Domain.Common.Core" Endpoint="CoreHostQueue"/>
</MessageEndpointMappings>
</UnicastBusConfig>
The subscriptions where not stored durably. Thanks to Andreas Öhlund for help!