I'm developing a chat module for a web plateform using the websocket protocol, and STOMP as a message protocol.

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.

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 ?

Here's my websocket configuration class :

public class WebSocketConfig implements WebSocketMessageBrokerConfigurer{

    public void registerStompEndpoints(StompEndpointRegistry registry) {

    public void configureMessageBroker(MessageBrokerRegistry registry) {

//Here's the line I wrote to use Kafka as a MB, but doesn't work        

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.

I'm using Kakfa's 2.2.0 release, Zookeeper's 3.4.14 release, and using STS 3 as my IDE.

Any help would be appreciated.

1 Answers

Gary Russell On

RabbitMQ doesn't natively support STOMP, but it has a STOMP plugin; Kafka has no built-in support for STOMP.