STOMP/Websocket architecture in Spring with decoupling between client and broker

Viewed 229

I was searching for some STOMP/Websocket examples with Spring and I found a lot of chats or news applications like this:

Architecture

I would like to know why the client is coupled with the broker (look at the arrow from Request channel to Simple broker) instead of interacting only with the Spring application. Also, beyond the coupling between client and the broker technology, I think that this architecture allows the client to publish in the broker bypassing the application (that, for instance, maybe it would like to implement some spam filter).

In some sense, this is like using the endpoints of some application and at the same time be able to query the application's database. It looks like an antipattern and I cannot find any advantage, only disadvantages like no decoupling and security issues.

I saw a lot of architectures using STOMP/Websocket designed in this way so probably I am not seeing something.

Thanks in advance.

0 Answers
Related