1
votes

I have started learning about NServiceBus to determine whether we can use NServiceBus the way we want. When I configured NServiceBus to use the JsonSerializer for serialization, I expected to be able to read the contents of the messages directly in the queue. But instead of being JSON formatted text, the body is hexadecmial. We would like to be able to open up a queue/table and view the contents of the messages without needing to convert every message from hex to text. Is this possible?

PS.: I am using NServiceBus v 5.2.14 and NServiceBus.Host v 6.0.0

1
Which transport are you using? MSMQ? - Udi Dahan
@UdiDahan: I am experimenting with both MSMQ and SQL Transport (different solutions that don't interact with eachother). However, the messages are stored as hex in both solutions. Ps.: just to clarify: the message is formatted correctly as JSON (hex to text converter displays the expected JSON) - jk1990
What tool are you using to read the messages? - Sean Farmar
the built in (ie Computer Management) Windows Message Queuing viewer only shows message bodies as hex. Try using another tool. - Chris Bednarski
For MSMQ I am viewing the messages in Visual Studio's Server Explorer. For SQL Transport I am looking at the rows in the databse. - jk1990

1 Answers

2
votes

There are several options:

MSMQ

For MSMQ I honestly believe the best option would be to use ServiceInsight. It gives you much more than just viewing the message payload but if you're in a position that you need to know why your system is behaving the way it is, this is the best option.

Regarding native tools for MQMS there are several options http://docs.particular.net/nservicebus/msmq/viewing-message-content-in-msmq

SQL Server Transport

While ServiceInsight works across all the transports, if you are using the SQL Transport and you just want to see content of your messages you can run a simple SQL query query:

SELECT CONVERT(VARCHAR(max), [Body]) FROM [YourQueue]

Having said that, you are technically converting message to text through this query.