I\'ve created an ASP.NET Core MVC/WebApi site that has a RabbitMQ subscriber based off James Still\'s blog article Real-World PubSub Messaging with RabbitMQ.
In his arti
You can get the service reference in Configure:
Configure
app.UseMvc(); var myServiceRef = app.ApplicationServices.GetService();
and then ie pass it to an init function or set a static member on a class
of course dependency injection would be a better solution as explained in the other answers ...