Alwyn
Alwyn

Reputation: 8337

Multiple instance of NServiceBus in one process?

Can I host multiple instance of NSB (and hence input queues) in one process?

I tried but it seems to want the input queue to be named after the executable name. May be I am missing a configuration?

In our test environment for ease of development we host multiple services in one process. I would like separate instances of NSB even when running in the same process, each with its own instantiation/boot strapping logic, and also input queues.

Upvotes: 0

Views: 237

Answers (2)

Chris Bednarski
Chris Bednarski

Reputation: 3414

As @mat3y said, this isn't supported in current version of NServiceBus (4.3)

However, Windows OS provides job objects that could allow you to manage multiple processes as a unit.

From MSDN:
A job object allows groups of processes to be managed as a unit. Job objects are namable, securable, sharable objects that control attributes of the processes associated with them. Operations performed on a job object affect all processes associated with the job object. Examples include enforcing limits such as working set size and process priority or terminating all processes associated with a job.

Upvotes: 0

mhertis
mhertis

Reputation: 61

NServiceBus uses a lot of statics (e.g for configuration) that are preventing such setup. Hopefully this will be possible in the future releases, Issue #1357.

Upvotes: 2

Related Questions