Implement message bus/pubsub subscriber in EPI

Vote:
 

Hi,

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? 

#231391
Nov 26, 2020 16:44
Vote:
 

Norbert,

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

#232698
Dec 02, 2020 11:51
Vote:
 

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.

#232962
Dec 02, 2020 13:45
Vote:
 

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 :)

#232994
Dec 03, 2020 6:52
Vote:
 

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

Love it. Looking forward to it!

Thanks for your answer.

#232995
Dec 03, 2020 6:56
* 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.