title: STOMP protocol implementation with Kafka
body: <p>I'm developing a chat module for a web plateform using the websocket protocol, and STOMP as a message protocol. </p>
  
  <p>It's my first time using any message broker, and Kafka is the one used on the company's (the one i'm working for) web plateform, for other modules I guess. And having previously worked with RabbitMQ when I was just starting, now I have to switch to Kafka. I saw on RabbitMQ's website there's a whole article about how to use STOMP, but there is no such thing on Kafka's official website.</p>
  
  <p>But I've explored several other sources, many tutorials and I couldn't find anything relevant about using STOMP protocol with Kafka, which leads me to ask if it's possible ? </p>
  
  <p>Here's my websocket configuration class :</p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @EnableWebSocketMessageBroker
  public class WebSocketConfig implements WebSocketMessageBrokerConfigurer{
  
      @Override
      public void registerStompEndpoints(StompEndpointRegistry registry) {
          registry.addEndpoint("/ws").withSockJS();
      }
  
      @Override
      public void configureMessageBroker(MessageBrokerRegistry registry) {
          registry.setApplicationDestinationPrefixes("/app");
          registry.enableSimpleBroker("/topic");
  
  //Here's the line I wrote to use Kafka as a MB, but doesn't work        
  registry.enableStompBrokerRelay("/topic").setRelayHost("localhost").setRelayPort(9092);
  </code></pre>
  
  <p>After lauching Kafka, and then running my Java Spring app, I get a "connection reset by peer" from a java.io.IOException, which is not supposed to be thrown if everything works fine.</p>
  
  <p>I'm using Kakfa's 2.2.0 release, Zookeeper's 3.4.14 release, and using STS 3 as my IDE.</p>
  
  <p>Any help would be appreciated.</p>