Example #1
0
        public async Task Publish(OutputRoute route, EventMetadata metadata, object body)
        {
            Logger.Info($"Publishing to exchange {route.Output}");
            var str   = JsonConvert.SerializeObject(body);
            var bytes = StringTools.GetBytes(str);
            await _bus.Advanced.PublishAsync(new Exchange(route.Output), "", false, new MessageProperties()
            {
                Headers = metadata.ToHeaders()
            }, bytes);

            Logger.Info($"Published to exchange {route.Output}");
        }