예제 #1
0
        public void Publish(byte [] body)
        {
            var properties = RequestChanel.CreateBasicProperties();

            properties.Persistent = true;
            RequestChanel.BasicPublish(exchange: "",
                                       routingKey: RoutiongKey,
                                       basicProperties: properties,
                                       body: body);
        }
예제 #2
0
        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);
        }