4

I'm new to Spring-Websocket and in the documentation and nearly all tutorials it's said that the simple in-memory broker can be used or alternatively a dedicated STOMP broker like RabbitMQ or ActiveMQ.

My main goal is to avoid unnecessary work by adding a dedicated STOMP broker to my project, even though I don't need it.

So, my question is what are the benefits of using a dedicated STOMP broker? When do I need a dedicated STOMP broker?

I don't want to know what the pros and cons of dedicated STOMP brokers are like in this post and I also don't want to know if I need a stomp broker like in this post.

Constantin Beer
  • 5,447
  • 6
  • 25
  • 43

1 Answers1

3

There are many things which enables you to choose between STOMP broker over simple in memory brokers.

  1. Scale-ability - STOMP brokers allows multiple producers and consumers thus allows scale whereas Web Socket In memory brokers are limited to the instance they are running in.
  2. Fault Tolerance - STOMP brokers are persistent and can allow retry where as Web Socket In memory brokers are "In Memory". During a failure the messages are gone for good.
  3. Monitoring - STOMP brokers are easy to monitor, where as Web Socket In memory brokers are not so much.

So you need to decide the scope of the application you are building to make the decision between STOMP brokers and In memory Web Socket Brokers.

shazin
  • 21,379
  • 3
  • 54
  • 71
  • can you explain second option more please? for example, when the client send message, the server dead before taking message. if server runs and takes connection again from broker, does it takes previous sent message from broker? did you meant that? can you give a use-case? – denizg Apr 22 '20 at 09:01