Beispiel #1
0
        public static MessageEnveloppe <T> GetMessageFromPublisher <T>(this NetMQMessage message)
        {
            var transportMessage = new MessageEnveloppe <T>()
            {
                Topic        = message[0].Buffer.Deserialize <string>(),
                MessageBytes = message[1].Buffer
            };

            transportMessage.Message = transportMessage.MessageBytes.Deserialize <T>();

            return(transportMessage);
        }
Beispiel #2
0
        public static MessageEnveloppe <T> GetMessageFromRouter <T>(this NetMQMessage message)
        {
            var transportMessage = new MessageEnveloppe <T>()
            {
                SenderId     = message[0].Buffer,
                MessageBytes = message[2].Buffer
            };

            transportMessage.Message = transportMessage.MessageBytes.Deserialize <T>();

            return(transportMessage);
        }
Beispiel #3
0
        public static MessageEnveloppe <T> GetMessageFromProducer <T>(this NetMQMessage message)
        {
            var transportMessage = new MessageEnveloppe <T>()
            {
                Topic        = Encoding.UTF8.GetString(message[0].Buffer),
                MessageBytes = message[1].Buffer
            };

            transportMessage.Message = transportMessage.MessageBytes.Deserialize <T>();

            return(transportMessage);
        }