DCSIMG
WCF 4 Routing Service – Runtime Governance - Zuker On Foundations

Zuker On Foundations

The realm of .NET (WPF, WCF and all around)
WCF 4 Routing Service – Runtime Governance

One of the goals for building the router facade at my workplace was to make it an essential runtime agent for registering runtime data to the governance realm I implemented.

The router sends meta-data of all the runtime messages that goes through it over to the governance registration service queue.

Basically, this means that I need a way to intercept every request and reply.

I couldn’t find a complete solution for that in the current WCF 4 Routing Service, which is the fourth point of failure.

The best way that I found to go about it was attaching my custom IDispatchMessageInspector to get a hold of every request, that works fine.

Unfortunately, not every reply goes through that layer.
For the duplex contract, which you should use for Net TCP binding and duplex communications, the reply message never goes through it.

This is due to the fact that in duplex communications, the reply messages are pushed directly to the communication channel of the caller, this is done by getting a hold of the callback contract and pumping the messages down to the client.

The problem is that there is no way to extend this behavior of the routing service to perform your own custom logic there, making it impossible to use it as a runtime governance agent with duplex communications as my need is.

Concluding failure points so far:

  1. WebHttp isn’t supported as much as I could tell
  2. I didn’t succeed with calling a O/W operation on a back-end service exposed with WsHttpBinding and Reliable Session enabled
  3. I didn’t find a way to control the contract of the channel shape used by the router service down the chain when calling to the back-end service. That prevented me from controlling the invocation pattern if I have more information regarding the target back-end service and operation.
  4. I didn’t find a way to get a hold of the reply messages in duplex communication mode in order to apply my custom logic such as logging the messages passed through it in runtime.

Published Thursday, January 21, 2010 3:41 PM by Amir Zuker

תגים:,

Comments

# re: WCF 4 Routing Service – Runtime Governance@ Tuesday, July 19, 2011 9:48 PM

Have you ever found a way to get a hold of the messages in Duplex mode? On another point do you have a samples of the IDispatchMessageInspector approach you used?

Brian Walk

# re: WCF 4 Routing Service – Runtime Governance@ Saturday, July 23, 2011 3:11 PM

I didn't find a way to get a hold of the reply messages using Duplex. That is due to the way reply messages are handling in duplex channel shape.

Rather then just returning the reply, the reply is pushed to the callback channel, as it should in two-way duplex communication.

I created a sample that uses a message inspector, feel free to take a look -

skydrive.live.com

RoutingServiceWithInspector.zip

Amir Zuker

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: