I have a database which has a number of queues which will contain messages from a 3rd party product. I would like to import these messages onto my Bus for processing and believe that I can achieve this with NServiceBus but I would like to host all the message importing within a single Windows Service that will have configuration on the database queue to monitor.
The processing steps are as follows:
1) Import onto Bus 2) transform into message 3) Send Bus message
Each NServiceBus would be configured to poll the database queue periodically. When a message arrives it will perform a Bus.SendLocal to perform step 1.
The NSB host would then receive process with a message handler. Within this message handler the transformation of the message would occur. Finally, the actually Bus message would be sent. Usual config would deal with the destination host.
I would like to understand whether multiple NSB hosts can be placed within a single Windows Service and if there are any issues associated with this? I believe that all hosts would need to share the same configuration (I am happy of this restriction), is that correct?
If multiple hosts is a 'no-no', my alternative is to have a Window Service with a Bus reference (singleton). A TPL task would monitor the database queue and then use the Bus to import the database message. A separate NServiceBus would handle or the imported database messages and perform the transformation and sending to other hosts.
Sorry about the length of the question.