protected virtual BaseMessage CreateNmsMessage(Message message)
        {
            BaseMessage result = null;

            if ("amqp/map" == message.ContentType)
            {
                Dictionary<string, object> dict = new Dictionary<string,object>();
                message.GetContent(dict);
                PrimitiveMap bodyMap = new PrimitiveMap();
                SetNmsPrimitiveMap(bodyMap, dict);
                MapMessage mapMessage = new MapMessage();
                mapMessage.Body = bodyMap;
                result = mapMessage;
            }
            else if ("amqp/list" == message.ContentType)
            {
                Collection<object> coll = new Collection<object>();
                message.GetContent(coll);
                ObjectMessage objMessage = new ObjectMessage();
                objMessage.Body = ConvertAmqpListToObject(coll);
                result = objMessage;
            }
            else
            {
                TextMessage textMessage = new TextMessage();
                textMessage.Text = message.GetContent();
                result = textMessage;
            }

            return result;
        }
예제 #2
0
        public ITextMessage CreateTextMessage(string text)
        {
            TextMessage answer = new TextMessage(text);

            return(answer);
        }
예제 #3
0
 public ITextMessage CreateTextMessage(string text)
 {
     TextMessage answer = new TextMessage(text);
     return answer;
 }
예제 #4
0
        public ITextMessage CreateTextMessage()
        {
            TextMessage answer = new TextMessage();

            return(answer);
        }
예제 #5
0
 public ITextMessage CreateTextMessage()
 {
     TextMessage answer = new TextMessage();
     return answer;
 }