public void Publish(byte [] body) { var properties = RequestChanel.CreateBasicProperties(); properties.Persistent = true; RequestChanel.BasicPublish(exchange: "", routingKey: RoutiongKey, basicProperties: properties, body: body); }
public void Publish(object body) { var formatter = new BinaryFormatter(); var serializationStream = new MemoryStream(); formatter.Serialize(serializationStream, body); var binaryRequest = serializationStream.ToArray(); var properties = RequestChanel.CreateBasicProperties(); properties.Persistent = true; serializationStream.Dispose(); RequestChanel.BasicPublish(exchange: "", routingKey: RoutiongKey, basicProperties: properties, body: binaryRequest); }