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
Labels

Comments

@darting
Copy link

@darting darting commented Apr 19, 2018

Hi there,

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

Thanks

@TomPallister

This comment has been minimized.

Copy link
Member

@TomPallister TomPallister commented Apr 19, 2018

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

@darting

This comment has been minimized.

Copy link
Author

@darting darting commented Apr 19, 2018

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

@TomPallister

This comment has been minimized.

Copy link
Member

@TomPallister TomPallister commented Apr 19, 2018

@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

This comment has been minimized.

@TomPallister

This comment has been minimized.

Copy link
Member

@TomPallister TomPallister commented Apr 19, 2018

@darting OK Ill take a look ASAP!

@darting

This comment has been minimized.

Copy link
Author

@darting darting commented Apr 19, 2018

thanks :)

@darting

This comment has been minimized.

Copy link
Author

@darting 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

This comment has been minimized.

Copy link
Member

@TomPallister 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.