Timeout in two-way receive port when redirecting failed messages

355 views Asked by At

I've a two-way WCF receive port, where i've checked both:

1) Route failed messages

2) Suspend request message on failure

This configuration is needed to redirect failed messages to our "exception portal".

When a message is received and it fails validation in XMLReceive pipeline, the message is redirected to our "exception portal" as expected.

The problem is however that the consumer of the WCF service never get's a fault, so the Connection gets a timeout after a while, which is very confusing for the consumer.

Is there anyway to fix this problem? Am I missing something?

1

There are 1 answers

0
Dan Field On BEST ANSWER

What's happening currently is that the message fails on the Receive pipeline, gets routed to your portal, but no response gets routed back. You have to make sure to send a message back. You could do that by:

  • creating an Orchestration that does the validation (instead of doing it on the pipeline), and making sure to send a response int he orchestration as well as routing failures to your portal
  • creating a custom component that validates the message (perhaps by calling the XML Validation pipeline in a try block and catching the exception without rethrowing it); on error it sends the message to your portal, and replaces pInMsg with something sensible to send back to the partner.
  • having your portal receive location be a request response port (perhaps, again, with an orchestration behind it), and route the response back to the WCF two way port. This way is more involved, and to be honest I'm not entirely sure what a working implementation would look like here, but it may be possible.

If it were up to me, I'd go for the Orchestration. You can certainly call the XML Validator pipeline from an orchestration, or you could use other validation logic in there (for example calling BRE).