0
votes

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.

2

2 Answers

2
votes

You should be able to use a Satellite to perform those kinds of DB queries and then forward onto the bus.

0
votes

What do you mean by "hosts"? Do you mean can one endpoint handle many different message types?

You can handle as many different message types as you want in a single host. The only restriction is that they will share the same queue, which means that all message types will be given the same priority (which is only a problem in very specific cases).