Implement message bus/pubsub subscriber in EPI



I would like to create a subscriber for an external message bus solution, so that the web server can listen/receive external events and react to it (e.g. resync data, update inventory, prices, ...).

But how would I create such a subscriber that runs continiously in the background. In .Net Core I would use IHostApplicationLifetime and start the pub sub listener on ApplicationStarted.

How would I do that in EPI server (11.14)? Could anyone give me some hints? 

Nov 26, 2020 16:44


How is it related to episerver? I guess the question is more like how to achieve this pubsub in ASP.NET right?

Dec 02, 2020 11:51

Hmm, yes, I guess you are right. I probably miss understanding on where in the startup code I would start the listener so that it runs all the time in the background.

E.g. using ModuleDependency(typeof(...)), [InitializableModule], or Startup.cs... And if there is some sort of best practice.

Dec 02, 2020 13:45

yeah, initializable module is the right place, epi handles the lifecycle so it starts after episerver is fully initialized and you can handle your specific pub/sub stuff

btw. we are pretty close with migrating epi to netcore, hopefully coming soon :)

Dec 03, 2020 6:52

btw. we are pretty close with migrating epi to netcore, hopefully coming soon :)

Love it. Looking forward to it!

Thanks for your answer.

Dec 03, 2020 6:56
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.