Message tracing in masstransit

353 views
Skip to first unread message

Kirill Yun

unread,
Jul 13, 2012, 11:45:31 PM7/13/12
to masstrans...@googlegroups.com

I use masstransit as service bus and I use pub/sub pattern for my application.

I would like to figure out if I can track message that comes up from the bus to subscribers.

I use json serializer.

Does MT have some 'entry point' in which I can get raw message body?

Here is the copy of this quesiotn on SO: http://stackoverflow.com/questions/11480833/message-tracing-in-mass-transit 

Travis Smith

unread,
Jul 13, 2012, 11:52:55 PM7/13/12
to masstrans...@googlegroups.com
Can you describe your need in more detail? There might be a better way than what you are asking for. 

-Travis
--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/j7V57nIY4UgJ.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en-US.


--
-Travis

Kirill Yun

unread,
Jul 14, 2012, 12:40:52 AM7/14/12
to masstrans...@googlegroups.com
Sure,

As aforesaid, I have publishers and subscribers. As a matter of fact, my 'subscription side' has a lot of logic and I want to log a message that comes up to the subscriber. To be precise, I want to have something like

MyMessage { Id: someId; Payload: somePayload }

in my log file. Just for debugging purposes.

On the one hand, I can merely log a message at the top of method responsible for handling of messages. On the other hand, I probably can simply log message before deserialization.

Hence, I'm looking for such an 'entry point' :)

Travis Smith

unread,
Jul 15, 2012, 5:21:05 PM7/15/12
to masstrans...@googlegroups.com
I can't think of a great way to do this on the consumer side off the top of my head. You could change the Consumes<MyMessage>.All to Consumes<MyMessage>.Accept, and have the new method on the interface always return true besides logging to your log file. 

If you're using MSMQ, you can turn on auditing of the queues and see what messages got sent through. On RabbitMQ, I'm unaware of an option like that. Though you can always bind another auditing queue to each exchange and get the same effect. 


- Travis

Reply all
Reply to author
Forward
0 new messages