Using Stateless Load Balancing

When you are coding for Stateless Load Balancing, ensure that session affinity does not exist for your request. You can avoid session affinity by not sending any cookies that may be used for session affinity (JSESSION and so on).

Generate a request for a token to the AIS Server by using either the /v2/tokenrequest endpoint or the /orchestrator/jde-login endpoint. After the token is returned, you can use it on any of the participating servers.

Use the established token to execute orchestrations (/orchestrator endpoint) or any AIS APIs on any of the AIS Servers participating in the load balancing. If you are using a load balancer, send the orchestration request to the load balancer url:port without cookies or other affinity mechanisms so that the orchestrator request can be routed to any of the participating AIS Servers.

You can also use the token to process the validation requests (/v2/tokenrequest/validate or orchestrator/jde-validate-session) on any of the participating AIS Servers. Include validation with touch to keep the session active.

To log out from the session on all the participating nodes, simply call logout (/v2/tokenrequest/logout or /orchestrator/jde-logout) once. This call will propagate the logout to all the nodes.

In some cases, specifically when load balancers are used, the device name may be required in the token request and in the subsequent requests. You can pass the device name in the body as “deviceName” or use the jde-AIS-Auth-Device URL parameter.

In the AIS log file, the mismatch warnings such as Get Session Device Name Mismatch 10.111.122.122!=10.222.33.44 indicate that the AIS Server cannot match the device name based on the requests from the load balancer and therefore you must use the device name in the requests to share the token across instances.