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 into CookieStickySessions own storage mechanism
Problem to solve
The current implementation of
CookieStickySessionscontainsConcurrentDictionary<string, StickySession> _storedwhere 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
CookieStickySessionsfor 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
CookieStickySessionsfor load balancing across these several Ocelot instances.To do so we need to have an ability to inject our own session storage implementation for
CookieStickySessionsNew Feature
Sessions storage implementations for
CookieStickySessionsload balancer.Add the ability to use
CookieStickySessionsfor Load Balancer across these several Ocelot instancesSteps to Reproduce the Problem
CookieStickySessionsCookieStickySessionsCreatorto inject intoCookieStickySessionsown storage mechanism