Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty HTTPClient connection reuse

Hello all,

 

I am using Jetty HttpClient to post messages to a messaging platform (Messenger). I am observing that sometimes when sending 2 messages one after the other (sent by the same thread just one after the other), the second message arrives on the messaging platform before the first.

I am using non-blocking method where ‘url’ is the same URL for both send:

 

Request request = httpClient.newRequest(url).method(HttpMethod.POST).content(..);

Request.send(new BufferingResponseListener(1024) {

                @Override

                public void onComplete(Result result) {…});

 

Is this behavior normal ? How could I be sure that the first connection created by the first send will be reused by the second send ?

If not possible, should I use a mechanism that would queue the requests and send them with the blocking method?

 

Thanks for your help.

 

Bruno

 


Back to the top