I want to add a class to the MessageContent of a MessageQueue before adding it in QueueStorage.

Example

class udpates
{
    public int userId {get; set; }
    public Datetime UpdateTime {get; set; }
}


queue.addMessage("instance of updates class")

How can i do that ?

thanks,

有帮助吗?

解决方案

Queue messages are either string or binary. You could serialize the object yourself and then enqueue the result.

Personally, I prefer string-based queue messages, as I can easily debug issues by pulling messages from a queue and viewing them without needing to decode. Also, it's easy to update a queue message when it's a string.

其他提示

Serialize to XML string is a good option.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top