tags:

views:

460

answers:

2

I would like to set the MSMQ message label using the NetMsmqBinding. I understand it’s easy when using the MsmqIntegrationBinding, but I would like to continue to use the NetMsmqBinding (even call private methods, if possible)

A: 

George: No answer, but I'm curious to know how you plan to use the MSMQ label together with NetMsmqBinding.

The reason I ask is that NetMsmqBinding was really created to support the scenario in which both the sending and receiving endpoints are both WCF applications, so at that point you might as well just stick any out-of-band data you need in the message headers...

tomasr
Correct - in the sending application, I would like to add a string identifying the message for operations - this would be extremely useful when the receiving endpoint is not running and messages are being *queued*...
George Tsiokos
WCF has built in queuing. http://msdn.microsoft.com/en-us/library/ms789048.aspx
Jonathan Parker
+2  A: 

I thought this was an interesting question. Unfortunately, from everything I've seen, it looks like you can't access the Label property on an outgoing MSMQ message using NetMsmqBinding.

Here are some of the links I came across:

I couldn't find anything that explained exactly why, but the reasoning makes sense - the NetMsmqBinding does not expose anything specific to System.Messaging, so that the binding itself can be easily swapped out for another binding without any code changes. Like you said, the MsmqIntegrationBinding is tightly coupled to System.Messaging concepts, so you get access to all the System.Messaging stuff at the expense of interchangability with other bindings. If setting the Label is important, the easiest route will probably be to just use msmqIntegrationBinding.

Andy White