[jetty-dev] How can I implement order guaranteed request for each Client IP?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] How can I implement order guaranteed request for each Client IP?

Sean
Now, I have some problem in using my Jetty + CXF.
That is,
When requests come in from a large number of Client IPs, Jetty distributes
them to Multi Threads.
At this time, the order is reversed when the request message is
retransmitted.

I try to bind the SOAP Requests coming in Jetty + CXF to each Queue by
Client IPAddress and sequentially process the Message in the Queue for each
client IP
(Request order should be guaranteed for each Client IP).
I would appreciate if you could show me how to implement it.



--
Sent from: http://jetty.4.x6.nabble.com/Jetty-Dev-f3247346.html
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] How can I implement order guaranteed request for each Client IP?

Greg Wilkins
Sean,

Even if Jetty did impose an order constraint between different connections (which it does not), this order would not be guaranteed at the client.  Different connections may be buffer or even routed differently through the network and packets in one connection may overtake packets in other connections from the same client.

So what you are trying to do is simply impossible at the network transport level.

If you want ordering, then you either have to use a single connection or somehow impose an ordering at the application level.

regards


On 21 July 2018 at 07:20, Sean <[hidden email]> wrote:
Now, I have some problem in using my Jetty + CXF.
That is,
When requests come in from a large number of Client IPs, Jetty distributes
them to Multi Threads.
At this time, the order is reversed when the request message is
retransmitted.

I try to bind the SOAP Requests coming in Jetty + CXF to each Queue by
Client IPAddress and sequentially process the Message in the Queue for each
client IP
(Request order should be guaranteed for each Client IP).
I would appreciate if you could show me how to implement it.



--
Sent from: http://jetty.4.x6.nabble.com/Jetty-Dev-f3247346.html
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev



--

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] How can I implement order guaranteed request for each Client IP?

Sean
Hi, Greg Thank you for your kind response. I already knew that the order is not guaranteed at the network transport level. I'm using Jetty + CXF as a "server", and I'm not interested in the order that the client sends. I just want the requests sent by multiple clients to put in the queues assigned to each IP at Jetty server. In order to do this, Jetty distributes the messages to the queue before they are assigned to them by Random Thread. I am looking for a way to stack up in the queue by IP within Jetty for this task. Apart from the client, I want to know the functions and settings that can manage the distributed queue by the request IP in the Jetty Server. Thank you. MessageProcess.JPG

Sent from the Jetty Dev mailing list archive at Nabble.com.

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] How can I implement order guaranteed request for each Client IP?

Greg Wilkins
Sean,

there is no single queue that maintains order of arrival of requests in Jetty.  Different requests will arrive on different connections, which may be handled by different selectors which run entirely independently of each other. Even if they are on a single selector, the order they are selected is entirely dependent in the implementation of the Set iterator, which has no guarantee about the order.

The design of jetty is specifically done so as to avoid synchronisation points that can become congested.  Jetty doesn't distribute requests to Random threads. The requests start off already distributed among random threads which do the  selection, IO and parsing.   There is no queue of requests, no centralised point of contention to base an ordering on.   There is no way of telling if one request was received before or after another.  This is deliberately by design and required so that jetty can scale.

We do set a timestamp on each request, but only to millisecond accuracy, so you can have several requests arriving at the same time, but even with nanosecond accuracy that would still be possible on a multi-core machine for 2 CPUs to receive requests from the same client at precisely the same time.  If you want an ordering, then you will need to create a data structure based on client IP that your application can synchronise on soon after receiving the request.

regards



On 21 July 2018 at 13:12, Sean <[hidden email]> wrote:
Hi, Greg Thank you for your kind response. I already knew that the order is not guaranteed at the network transport level. I'm using Jetty + CXF as a "server", and I'm not interested in the order that the client sends. I just want the requests sent by multiple clients to put in the queues assigned to each IP at Jetty server. In order to do this, Jetty distributes the messages to the queue before they are assigned to them by Random Thread. I am looking for a way to stack up in the queue by IP within Jetty for this task. Apart from the client, I want to know the functions and settings that can manage the distributed queue by the request IP in the Jetty Server. Thank you. MessageProcess.JPG

Sent from the Jetty Dev mailing list archive at Nabble.com.

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev



--

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] How can I implement order guaranteed request for each Client IP?

Sean
Hi, Greg

I respect your activity.

Your advice helps relieve of many uncertainties about Jetty.
Thank you very much.

Best Regards

Sean



--
Sent from: http://jetty.4.x6.nabble.com/Jetty-Dev-f3247346.html
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev