title: AWS Application Load Balancer WebSocket metadata based stickiness?
body: <p>We have a cluster of some service. The clients connect to the cluster via Websocket. The clients are targeted to nodes based on the group they belong to (lets call it a "conference").</p>
  
  <p>In other words, a whole group of clients (conference) is served by one particular node. So, the target node should be selected based on some metadata sent when initiating the WebSocket connection.</p>
  
  <pre><code>Client Tom Hanks connects to Actors     conference -&gt; LB routes to node EU Server
  Client Tom Hanks connects to Tesla fans conference -&gt; LB routes to node USA Server
  
  Client Ada Zizkova connects to Actors     conference -&gt; LB routes to node EU Server
  Client Ada Zizkova connects to Tesla fans conference -&gt; LB routes to node USA Server
  ...
  </code></pre>
  
  <p><strong>Notice that this is NOT a HTTP session based stickiness.</strong> The HTTP session is the same one for the same user.</p>
  
  <p>All this is what we would like to have. But currently we are at the simple AWS Elastic Load Balancer and we are about to implement this stickiness in-house and bypass the ELB. </p>
  
  <p>Before doing that, I am looking into whether the ALB could do what I described above. Can't find anything, just this: <a href="https://stackoverflow.com/questions/39336033/does-an-application-load-balancer-support-websockets">Does an Application Load Balancer support WebSockets?</a> Which looks like a general connection stickiness. See <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html" rel="nofollow noreferrer">AWS docs here</a>.</p>
  
  <p>How can I do a metadata-based WebSocket stickiness with ALB? (Or with something else in AWS).</p>