Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web service that accepts POST requests. This is a network internal service where internet attacks are not a concern at this layer. However, it's not always fast. The user doesn't need the entity info of the POST response. I'd like to put in place a proxy that accepts any POST, returns 202 status, and forwards the request asynchronously to the real service.

I can't find a proxy that does this! Either it's a message queue of some sort, where the destination needs to poll, or its a proxy like squid or nginx that waits for the remote service to complete.

What am I missing? Is there one somewhere? Does nobody else have the need to asynchronize POST processing?

share|improve this question

I don't think a proxy can do this for you, as its job is to proxy requests, not take them and shut down.

I have had a few thoughts on tackling the problem -

I recon the best bet would be to knock something up yourself, for example using PHP and Curl. (ie Accept the request and generate a new request with the same parameters, optionally adding an X-Forwarded-For header).

I have not looked at it in this kind of depth, but you could also look at mod_security - I believe it has the ability to mangle packets going through the server, so you could possibly force this into doing your bidding.

share|improve this answer
    
A proxy can intercept requests and send its own replies. As a frequent example, if you provide incorrect login/password, the proxy sends its own "Authentication failed" reply. There is no technical reason that it could not send its own replies to ordinary POST requests. – grawity Mar 12 '13 at 14:36
    
An interesting reply @grawity (although I don't entirely agree, you could be on to something)- I look forward to you advising how a proxy might be configured to do this. – davidgo Mar 12 '13 at 17:35
    
I really don't want to roll my own if I can avoid it. It seems WebSphere and WebLogic have these kinds of proxies as part of their SoA enterprise suites, so it seems like it can be done -- just not on a budget or technology stack I'm comfortable with :-) – Jon Watte Mar 12 '13 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .