title: To build spring integration channel as spring websocket doesn't support messaging for non-stomp client
body: <p>As we are not using stomp for our websocket server, spring doesn't offer message broker framework. My vision is to use spring messaging pub/sub with Redis message store for dev and migrate message broker from Redis to SQS+Dynamo for prod version. </p>
  
  <p>As I exclude (since ios &amp; Android not ready to put stomp client infront due to lack of support) Stomp, spring websocket library doesn't enable pub/sub function as well.</p>
  
  <p>Our Business case example:</p>
  
  <p>Every connected websocket session will initiate request to another microservice (which is a Java websocket client) to get data.  My vision is to connect these two service through pub/sub architecture with redis.</p>
  
  <ol>
  <li>Mobile client sends -> "Hi, Is my bill paid?" through websocket.</li>
  <li>Websocket server receive this message and pass it to websocket 
  client service through redis pub/sub.</li>
  <li>As websocket server and Websocket client are connected via Redi 
  pub/sub. They can exchange messages.</li>
  <li>Websocket client will be connected to human agents system via socket 
  and pass "Hi, Is my bill paid?".</li>
  <li>The response ("Yes, it is paid.") will be again published to 
  websocket server.</li>
  <li>Websocket server will send it back to specific user destination.</li>
  </ol>
  
  <p>Due to business reason we would like to keep 2 services for this use case. Websocket client can connect to customer agent system and its decoupled from our business logic.
  Our mobile apps will speak to our own websocket server. This gives us a flexibility to add more customization and independent from a specific vendor.</p>
  
  <p>Here is my workaround</p>
  
  <ol>
  <li>Use spring-websocket without stomp to create Websocket server.</li>
  <li>Use spring-Integration to create messaging architecture.</li>
  <li>Every websocket session is bound to a spring integration channel and 
  send response to user specific destination. </li>
  <li>Create a Redis request/response queue for every connection.</li>
  <li>Spring integration channel subcribe to redis queue.</li>
  </ol>
  
  <p>As our infrastructure doesn't offer Rabbit MQ support, Redis queue will be replaced by SQS in prod.</p>
  
  <blockquote>
    <p>Question: 
    Can we create spring integration channels at runtime and bind to specific service or queue? Thought process is to offer one
    channel per websocket session and delete channel when session ends.</p>
    
    <p>Is there a better alternate solution available in spring integration or
    spring messaging to execute this use case?</p>
  </blockquote>