hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Breu" <Konstantin.B...@gmx.net>
Subject AW: AW: httpclient proxy timeouts with long responses
Date Wed, 08 Nov 2006 23:18:29 GMT
> We are already using the first idea but have a problem if an error
> happens.  We cannot notify the client that the error has happened
> because we have already started to write to the stream.  The client now
> does not know what happened and will process everything like normal, in
> which case they get an empty string as the response, which results in a
> failure (expecting XML).
Well, if an error occurs you could also send error information in a
multipart response part - also as XML. But: I don't know in how far
HttpClient offers support for multipart responses. Hopefully the httpclient
gurus can answer that question. ;-) 
Anyway, I would prefer the way polling the server (which was my idea number
2). That's what I use in such situations in normal cases, and I think many
other developers, too. Whereas I don't know much real-world solutions using
http push.

Here is some info about pull + push:
http://wp.netscape.com/assist/net_sites/pushpull.html
http://www.unix.org.ua/orelly/web/html/ch14_03.html


> -----Urspr√ľngliche Nachricht-----
> Von: Daniel Lapadat [mailto:Daniel.Lapadat@baesystems.com]
> Gesendet: Mittwoch, 8. November 2006 23:02
> An: HttpClient User Discussion
> Betreff: Re: AW: httpclient proxy timeouts with long responses
> 
> Breu,
> 
> Thanks for the ideas.
> 
> We are already using the first idea but have a problem if an error
> happens.  We cannot notify the client that the error has happened
> because we have already started to write to the stream.  The client now
> does not know what happened and will process everything like normal, in
> which case they get an empty string as the response, which results in a
> failure (expecting XML).  On the server end we will get an
> IllegalStateException because we have already committed.  Also I
> believe that to use a multipart response I would need to have all of
> the data upfront, at least that is what it looks like in the API
> documentation for HTTPClient.
> 
> If I understand you, you are suggesting to take an asynchronous
> approach, which I would like to avoid as it would involve a rewrite.
> You are suggesting that we basically poll the server for when our
> information is done, right?
> 
> Dan
> 
> Konstantin Breu wrote:
> > 2 ideas:
> >
> > - kind of http push: send a multipart response; the first parts are
> > sent every x second/minute just to make the proxy keep the
> connection;
> > the last part contains the "real response"; of course the client will
> > have to look for the parts to get information about processing/result
> >
> > - or a solution with multiple requests during processing (every x
> > second/minute) until the response is generated
> >
> >> -----Urspr√ľngliche Nachricht-----
> >> Von: Daniel Lapadat [mailto:Daniel.Lapadat@baesystems.com]
> >> Gesendet: Mittwoch, 8. November 2006 20:13
> >> An: httpclient-user@jakarta.apache.org
> >> Betreff: httpclient proxy timeouts with long responses
> >>
> >> I have not been able to find a solution to the following problem.
> >>
> >> We have an application that talks to servlets using HTTPClient.  It
> >> requests information from the servlets, sometimes the response can
> >> take a long time ( > 10 minutes ).  Everything was working fine
> until
> >> some of our new users sat behind a proxy server.  The proxy server
> is
> >> timing out our HTTP connection at around 5 minutes.  We of course
> >> cannot modify any of the proxy server's settings.  Is there some way
> >> of sending a keep alive signal to the proxy server?
> >>  I thought that HTTP 1.1 automatically did this.
> >>
> >> The only solution we have found is to start writing white space back
> >> to the client every couple of seconds but if we do that and there is
> >> an error on the server side, the client will not get any response
> >> back from the server because we started to write to the output
> stream
> >> of the HTTPResponse object.  sendError causes an
> >> IllegalStateException on the server end.  In order to avoid this we
> >> cannot write to the output stream until we have a response from the
> database or other systems.
> >>
> >> Any help would be appreciated,
> >>
> >> Dan
> >>
> >> --------------------------------------------------------------------
> -
> >> To unsubscribe, e-mail:
> >> httpclient-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: httpclient-user-
> >> help@jakarta.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-
> unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > httpclient-user-help@jakarta.apache.org
> >
> 
> --
> Daniel Lapadat
> Software Engineer
> BAE Systems -- National Security Solutions 6310 Hillside Court Suite
> 200 Columbia, MD 21046
> Office: 410-309-9366 x 2096
> Fax:    410-309-9370
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-
> help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message