public void Publish(IRoute route, IMessage message, Action<IBasicProperties> propsVisitor = null)
{
var nativeRoute = (RabbitRoute)route;
Logger.Trace(m => m("Emitting message [{0}] ({1}) through [{2}].", message.Label, message.Payload, nativeRoute));
IBasicProperties props = this.Native.CreateBasicProperties();
byte[] body = this.Bus.PayloadConverter.FromObject(message.Payload);
if (props.Headers == null)
{
props.Headers = new Dictionary<string, object>();
}
props.ContentType = this.Bus.PayloadConverter.ContentType;
props.Timestamp = new AmqpTimestamp(DateTime.UtcNow.ToUnixTimestamp());
if (propsVisitor != null)
{
propsVisitor(props);
}
message.Headers.ForEach(i => props.Headers.Add(i));
this.Bus.MessageLabelHandler.Inject(props, message.Label);
this.SafeNativeInvoke(n => n.BasicPublish(nativeRoute.Exchange, nativeRoute.RoutingKey, false, props, body));
}