Is it possible to configure an endpoint to act as a worker retrieving jobs from a distributor AND subscribe to some kind of messages?
I have the following scenario ( adapted to sale terminology)
*) a central department publishes every now and then a list of the new prices. All workers have to be notified. That means, a worker should subscribe to this event.
*) when a new order arrives at the central, it sends it to the distributor, which send it to the next idle worker to be processed. That means, a worker have to be configured to receive messages from the distributor. I use the following configuration:
<MsmqTransportConfig
InputQueue="worker"
ErrorQueue="error"
NumberOfWorkerThreads="2"
MaxRetries="5"
/>
<UnicastBusConfig
DistributorControlAddress="distributorControlBus"
DistributorDataAddress="distributorDataBus" >
<MessageEndpointMappings>
<add Messages="Events" Endpoint="messagebus" />
</MessageEndpointMappings>
</UnicastBusConfig>
When I configure it only as a worker or only as a subscriber everything works as expected, but not when I configure it as both.
I discovered that a message arrives at the input queue of the central with the address of the distributor as return address instead of worker address, and the publisher recognize no subscriber in this case. Any ideas? Thanks in advance.