Description
Problem to solve
The current implementation of CookieStickySessions
contains ConcurrentDictionary<string, StickySession> _stored
where all the sessions are stored.
We faced a situation when we need to have a few Ocelot instances on-premise of the customer
and we have some services that enforces us to use CookieStickySessions
for our Load Balancer (https://ocelot.readthedocs.io/en/latest/features/loadbalancer.html#cookiestickysessions).
Having several instances of Ocelot push us to add the ability to use CookieStickySessions
for load balancing across these several Ocelot instances.
To do so we need to have an ability to inject our own session storage implementation for CookieStickySessions
New Feature
Sessions storage implementations for CookieStickySessions
load balancer.
Add the ability to use CookieStickySessions
for Load Balancer across these several Ocelot instances
Steps to Reproduce the Problem
- extract sessions collection from
CookieStickySessions
- make a public interface for session storage so users can implement their own mechanism of storing user sessions such as distributed sessions storage etc.
- substitute
CookieStickySessionsCreator
to inject intoCookieStickySessions
own storage mechanism