Ejemplo n.º 1
0
        public async Task Invoke(HttpContext context, IMessageBroker messageBroker)
        {
            // this method is called on every http request

            DateTime requestTime = DateTime.Now;

            await next.Invoke(context);

            CollectorAccessEvent newEvent = new CollectorAccessEvent(
                ServiceConfiguration.Instance.serviceId,
                context.Request.Method,
                context.Request.Path,
                context.Request.QueryString.ToString(),
                context.Connection.RemoteIpAddress.ToString(),
                context.Connection.RemotePort,
                requestTime,
                context.Response.StatusCode,
                context.Response.ContentType,
                context.Response.ContentLength);

            messageBroker.PublishCollectorAccessEvent(newEvent);
        }
Ejemplo n.º 2
0
 public void PublishCollectorAccessEvent(CollectorAccessEvent newEvent)
 {
     this.PublishEvent(newEvent,
                       this.config.collectorTopic,
                       this.config.accessEventFilter);
 }