Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sticky sessions for load balancer #322

Closed
darting opened this issue Apr 19, 2018 · 8 comments · Fixed by #336
Closed

Support sticky sessions for load balancer #322

darting opened this issue Apr 19, 2018 · 8 comments · Fixed by #336
Labels
feature A new feature Load Balancer Ocelot feature: Load Balancer merged Issue has been merged to dev and is waiting for the next release

Comments

@darting
Copy link

darting commented Apr 19, 2018

Hi there,

Does Ocelot support sticky session for load balance? And how to configure it?

Thanks

@TomPallister
Copy link
Member

@darting thanks for your interest in the project. At the moment Ocelot does not have any specific support for sticky sessions.

@TomPallister TomPallister added the question Initially seen a question could become a new feature or bug or closed ;) label Apr 19, 2018
@darting
Copy link
Author

darting commented Apr 19, 2018

hi @TomPallister, do you have any plan to support it? :)

@TomPallister
Copy link
Member

@darting I’m not sure, Ocelot has a load balancer abstraction so using some kind of identifier it shouldn’t be too hard. How would you want this to work?

@darting
Copy link
Author

darting commented Apr 19, 2018

@TomPallister
Copy link
Member

@darting OK Ill take a look ASAP!

@darting
Copy link
Author

darting commented Apr 19, 2018

thanks :)

@darting
Copy link
Author

darting commented Apr 19, 2018

hi @TomPallister, I think my scenario a bit complicated. the sticky sessions still not really work well for me. The first I need 100% sure the same http request should forward to same server. The second the Api server domain not same with the Front end, so I can not just use 'Set-Cookie'. Sticky sessions by query string for my case a bit complicated, since the querystring is encrypted. Now I am thinking, is it possible to write a custom load balancer and plugins to Ocelot. I think what I need is just a custom function generate an identifier for every request.

Not really familiar with Ocelot, if I want to do myself which part I should start to check first?

@TomPallister
Copy link
Member

TomPallister commented Apr 20, 2018

@darting take a look at ILoadBalancer and it’s implementations. Also look at the load balancing middleware. You might be able to do the work here with a new load balancer.

All the requests get a guid from asp.net HttpContext.TraceIdentifier already!

@raman-m raman-m added feature A new feature Load Balancer Ocelot feature: Load Balancer merged Issue has been merged to dev and is waiting for the next release and removed question Initially seen a question could become a new feature or bug or closed ;) labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature Load Balancer Ocelot feature: Load Balancer merged Issue has been merged to dev and is waiting for the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants