<div>Hi,<br></div><div><br></div><div>I'm building an application where people can use websocket connections to receive streaming data from Kafka topics.  <br></div><div><br></div><div>Currently, I use Cowboy 2.5 to manage the websockets.  It works great!<br></div><div><br></div><div>However, I can only have ONE websocket subscribe to a Kafka topic using brod.  When The second person connects and subscribes, brod returns an error: {error,{already_subscribed_by,<0.1374.0>}}<br></div><div><br></div><div><div>In the Cowboy websocket handler, I handle subscription requests with a simple brod subscribe call:<br></div><span style="color:rgb(38, 127, 153)">brod</span><span style="color:rgb(0, 0, 0)">:</span><span style="color:rgb(121, 94, 38)">subscribe</span><span style="color:rgb(0, 0, 0)">(api_brod_client, </span><span style="color:rgb(121, 94, 38)">self</span><span style="color:rgb(0, 0, 0)">(), </span><span style="color:rgb(0, 16, 128)">Topic</span><span style="color:rgb(0, 0, 0)">, </span><span style="color:rgb(9, 136, 90)">0</span><span style="color:rgb(0, 0, 0)">, [])<br><br><br>Perhaps that's not the optimal way. <br><br>I did read that brod has a higher level call:  brod_topic_subscriber:start_link.  However, that wants a module it can callback with an init.  Since there is already a websocket process running from Cowboy, I don't want broad to start it again. <br><br>does anybody know of a simple way to have each websocket process just subscribe to the Kafka topic.  The brod_topic_subscriber might work, if there is a way to just feed the mssages back to the cowboy process calling it.<br></span></div><div style="color: #000000;background-color: #ffffff;font-family: Menlo, Monaco, 'Courier New', monospace;font-weight: normal;font-size: 12px;line-height: 18px;white-space: pre;"><div><br></div></div><div>Thoughts?<br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div>--<br></div><div>Noah <br></div><div><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div>