close
The Wayback Machine - https://web.archive.org/web/20201103131113/https://github.com/ThreeMammals/Ocelot/issues/729
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 ServiceDiscoveryProviders #729

Open
MartinCarpentier opened this issue Dec 29, 2018 · 2 comments
Open

Support sticky sessions for ServiceDiscoveryProviders #729

MartinCarpentier opened this issue Dec 29, 2018 · 2 comments

Comments

@MartinCarpentier
Copy link

@MartinCarpentier MartinCarpentier commented Dec 29, 2018

Expected Behavior / New Feature

Support sticky sessions for ServiceDiscoveryProviders

Actual Behavior / Motivation for New Feature

When using websockets with ocelot in a distributed system, problem can arise since ocelot, as far as i know, doesn't support sticky sessions when working with service discovery providers.

The functionality could be great if it could work with both consul and servicefabric.

Feel free to delete this issue if i'm wrong.

@philproctor philproctor self-assigned this Jan 2, 2019
@philproctor
Copy link
Member

@philproctor philproctor commented Jan 2, 2019

I'll have to investigate this to find out if it's true, though I'm not sure it's totally appropriate to address if it is true.

Sticky sessions are not generally recommended and the reason why is that requests from one client are always directed to the same server, making that client dependent on that server. If you are using Service Discovery and the server drops from the pool, any clients that were sticky to that server will experience a loss of session and have other potential side effects. It doesn't seem like SD + Sticky Sessions would mix very well, especially in an environment where servers change frequently.

That being said, we do offer both, so we probably should implement a fix at some point if it doesn't already work.

@MartinCarpentier
Copy link
Author

@MartinCarpentier MartinCarpentier commented Jan 3, 2019

It's true that sticky sessions are generally not favorable. But in some cases the underlying technology needs it. (Sadly)

If I understand your documentation correctly it's not supported. I might be mistaken though and if i am that would be great.

The reason why I would like sticky sessions is that we plan to use SignalR.
SignalR requires sticky sessions, so that the initial negotiations with the server reaches the same server every time.

I have looked into the ServiceFabric implementation and it looks like you're using the ServiceFabric reverse proxy for the load distribution?
If that's the case then Ocelot will not be able to support sticky sessions through ServiceFabric with the current implementation since the SF ReverseProxy doesn't support it.

There is an endpoint in ServiceFabric for retrieving information about each service that's running on the system (Service Discovery Provider) but it doesn't look like you're using it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.