views:

98

answers:

2

I'm writing a sample console service host and I want to plug into WCF stack to be able to print a message to console when new message arrives, even if it won't get processed by the service at the moment (because service is working on previous calls). This is based on my assumption that messages arriving get queued by the WCF, is that correct?

Additionally, I'm using netTcpBinding if this is important.

A: 

You probably have to write a custom channel for that. Check out WCF Channels Mini Book

aogan
A: 

You could write a custom channel and insert it into the channel stack at whatever point you want. Queuing happens in ChannelListeners, which sit between each channel:

ChannelListener_1 -> Channel_1 -> ChannelListener_2 -> Channel_2 -> etc.

So, if you were to insert your own channel listener / channel you could hook into any part of the process you need to. Note however that the message contents might not be readable until it gets farther down the stack and gets decrypted.

jezell