Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Java HTTP sessions + multiple publishers + CDN+load-balancer: how to make it work?

Avatar

Level 9

an example might best explain the problem:

  1. user requested to load a page with a form. User came through to pub1 (we have 3 publishers)

  2. When user submits the form, AEM (let's call it validate-form servlet) will validated the form by calling an integration API. validate-form sevlet will then  store the API response to an HTTP session (for security) if API call returns with a success message. (request was processed by pub1)

  3. Before the user can proceed to the next step, we need to send an OTP (let's call this one send-OTP servlet) and I need to retrieve the ID from the session before I can send the OTP (sending OTP is done by calling an integration API). (in this instance, request to send OTP is processed by pub2)

because it's a server session, my send-OTP servlet (in pub2) does not have access to session stored in pub1.

 

What are my options in making it work?

 

These are the ideas that's coming to me right now:

  1. enable sticky sessions in either Cloudfront or ELB (unsure which one to use as I'm not a platform person but a quick google search tells me sticky sessions is available on those 2 products) (in our setup, we have cloudfront 
  2. using encrypted cookies

Another question: Can someone please explain what's "/stickyconnectionsfor" in the dispatcher config. I've read the explanation on this page and it seems this is not what I want. (our publishers and dispatcher is configured as 1-to-1 anyway)

 

Thanks for the response.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @jayv25585659 
Both options look good. we had implemented both of them in 2 different projects.

 

Go with stick session for area of content, I think that you can do from Adobe load-balancer, there are target groups and you can apply sticky in one of them. for this approach you have to manage the path pattern.

 



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @jayv25585659 
Both options look good. we had implemented both of them in 2 different projects.

 

Go with stick session for area of content, I think that you can do from Adobe load-balancer, there are target groups and you can apply sticky in one of them. for this approach you have to manage the path pattern.

 



Arun Patidar