This project is read-only.


Submit request to HttpServer in MessageHandler cause failure during pipeline creation


Check out the attach sample. It is built based on Brad's batching sample:

One customized message handler is added to the global configuration. Run the client, you will notice all the inner request are return 400 Bad Request.

The exception happens in HttpClientFactory.CreatePipeline. When a request is submitted to HttpServer, the server tries to ensure the pipeline is created, which invoke a re-create a established pipeline.

file attachments

Closed Sep 11, 2013 at 10:37 PM by yishaigalatzer
Since we implemented batching in the framework. We don't feel it's important to fix anymore.

If there is another scenario requiring fixing this, feel free to re-open and specify the scenario.


HongmeiG wrote Jun 22, 2012 at 5:57 PM

We will fail because we tried to wire up the message handler twice.

HongmeiG wrote Jun 26, 2012 at 1:55 AM

We should consider making this experience better. Possible solution could be:
  1. Making a configuration a clonable object;
  2. Instead of throw exception, allowing the config to be re-used;

roncain wrote Jul 19, 2012 at 1:49 PM

The actual error is attempting to wire up the pipeline twice. I've tested a local fix in CreatePipeline to simply detect the inner handlers are already set and return. Here is the code for CreatePipeline (added immediately after checking input parameters):
         DelegatingHandler firstHandler = handlers.FirstOrDefault();
        if (firstHandler != null && firstHandler.InnerHandler != null)
            return firstHandler;
Alternatively, the config would need to carry state that its handlers had been initialized.

HongmeiG wrote Mar 29, 2013 at 2:18 AM

Yes, we should remove this throw.

eilonlipton wrote Jun 17, 2013 at 1:00 AM

Moving to vNext. In the meantime we recommend using the mitigation described in this blog post:

blake05 wrote May 22, 2014 at 9:17 PM

Please reopen this issue to ensure it's fixed in vnext