我无法从msmqueue的消息体中读取消息 [英] I am unable to read message from message body of msmqueue

查看:67
本文介绍了我无法从msmqueue的消息体中读取消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里取了标签,但无法阅读身体背景信息。



我尝试过的事情:



Here I have fetch the label but unable to read the message of body contet.

What I have tried:

foreach (Message message in msgQueue.GetAllMessages())
                {
                    MSMQMessage msmqmessage = new MSMQMessage();

                    msmqmessage.Label = message.Label;
                    message.Formatter = new XmlMessageFormatter(new String[] { "System.String,mscorlib" });
                    msmqmessage.MessageID = message.Body.ToString();
                    string.message=body
                    msgList.Add(msmqmessage);
                }
                grdMessage.DataSource = msgList;
                grdMessage.DataBind();

推荐答案

我有点担心



Im a bit worried about

msmqmessage.MessageID = message.Body.ToString();
string.message=body





什么是string.message = body实际上在做什么?我能理解





what is string.message=body actually doing ? I could understand

String aMessageBody = (String)message.Body;





或在你的情况下





or in your case

msmqmessage.Body = (String)message.Body;





因为我也担心





as Im also worried about

msmqmessage.MessageID = message.Body.ToString();





真的吗?你想通过将消息体分配给ID字段



really ? what are you trying to achieve by assigning the message body to the ID field


这篇关于我无法从msmqueue的消息体中读取消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆