Reputation: 8882
I have the following Setup:
One service called CoreHost
should receive a ExecuteWorkflowByAttributeCommand
which is Bus.Send
to it and publish WorkflowByAttributeExecuted
afterwards.
One "client" which uses Bus.Send
to execute the command and is subscribed to the WorkflowByAttributeExecuted
message.
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>
Upvotes: 1
Views: 688
Reputation: 8882
The subscriptions where not stored durably. Thanks to Andreas Öhlund for help!
Upvotes: 1
Reputation: 31750
Be aware that the publisher will only evaluate the subscription successfully if the version and public key token of the assembly holding the messages you are publishing are identical on both publisher and subscriber.
The reason for this is that the subscription messages sent by the subscriber to the publisher on start up contain this information.
Check the subscription messages stored in the publishers subscription store and make sure the version/PKT match with the subscribers.
Upvotes: 0