Ejemplo n.º 1
0
 public AuthorisationsController(ILogger <AuthorisationsController> logger,
                                 RabbitMqDefaultClient rabbitMqDefaultClient, RabbitMqRpcClient rabbitMqRpcClient)
 {
     _logger        = logger;
     _defaultClient = rabbitMqDefaultClient;
     _rpcClient     = rabbitMqRpcClient;
     _queryBuilder  = new QueryBuilder();
 }
        public static IApplicationBuilder UseRabbitRpcClient(this IApplicationBuilder app)
        {
            RpcClient = app.ApplicationServices.GetService <RabbitMqRpcClient>();
            var lifetime = app.ApplicationServices.GetService <IHostApplicationLifetime>();

            lifetime.ApplicationStarted.Register(OnRpcStarted);

            //press Ctrl+C to reproduce if your app runs in Kestrel as a console app
            lifetime.ApplicationStopping.Register(OnRpcStopping);

            return(app);
        }