I am trying to use Topshelf to create a Rebus endpoint that will run as a service. How should this be set up and are there any examples?
相关问题
- How does Rebus work with Azure Service Bus topics?
- Rebus subscriber-publisher system. Process message
- Serial processing of a certain message type in Reb
- How to configure a Rebus endpoint to run as a serv
- Pub sub pattern with centralized subscription stor
相关文章
- 如何配置卤面端点作为服务运行(How to configure a Rebus endpoint t
- 在Rebus的特定消息类型的串行处理(Serial processing of a certain
- Rebus subscriber-publisher system. Process message
- Serial processing of a certain message type in Reb
- How to configure a Rebus endpoint to run as a serv
- Pub sub pattern with centralized subscription stor
- Rebus, exception when creating AppDomain / Instanc
- Rebus and Remote queues
You can take a look at the Rebus samples repository, where the integration service sample in particular shows what you're after.
As you can see in Program.cs it uses Topshelf to basically just hold on to a Windsor container, which it disposes when the application shuts down.
The Castle Windsor installer syntax causes the installers to be automatically picked up, where the RebusInstaller shows how you'd typically let Rebus inject itself into your container, and the HandlerInstaller shows how you can add handlers to the container.
It should be fairly easy to adapt the sample to use another container - just remember to dispose it when the application shuts down, thus giving Rebus a chance to finish messages currently being handled and stop its worker threads.