websss
asked on
write to MS message queue and retrieve it
Hi
I can successfully write to the MS message queue by doing this:
where "this" is a class called clsCommon.cs and is a populated object with values
Then on another console app, i need to read this message and i guess deserialise it
i.e.
any ideas?
I can successfully write to the MS message queue by doing this:
using (MessageQueue alertsQueue = new MessageQueue(Program.alertsQueuePath))
{
BinaryMessageFormatter formatter = new BinaryMessageFormatter();
System.Messaging.Message message = new System.Messaging.Message(this, formatter);
alertsQueue.Send(message, "CommonObject");
}
where "this" is a class called clsCommon.cs and is a populated object with values
Then on another console app, i need to read this message and i guess deserialise it
i.e.
public void MqReceiveCompleted(object sender, ReceiveCompletedEventArgs e)
{
try
{
mq.EndReceive(e.AsyncResult);
clsCommon objClsCommon = new clsCommon();
string strObjClsCommon = e.Message.Body.ToString();
//here is need to convert the string I just got into objClsCommon
any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Only response provided. Serialization question answered by suggesting Newtonsoft.Json.