Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the major difference between SimpMessageHeaderAccessor vs StompHeaderAccessor Spring + java

Tags:

java

spring

stomp

What is the major difference between SimpMessageHeaderAccessor vs StompHeaderAccessor Web Socket Spring?

Please explain elaborately if you know about this?

like image 760
Amit Avatar asked Sep 10 '17 08:09

Amit


People also ask

What is StompHeaderAccessor?

public class StompHeaderAccessor extends SimpMessageHeaderAccessor. A MessageHeaderAccessor to use when creating a Message from a decoded STOMP frame, or when encoding a Message to a STOMP frame.

What is SimpMessagingTemplate?

public class SimpMessagingTemplate extends AbstractMessageSendingTemplate<String> implements SimpMessageSendingOperations. An implementation of SimpMessageSendingOperations . Also provides methods for sending messages to a user.


1 Answers

This has a simple answer: SimpMessageHeaderAccessor is the parent of StompHeaderAccessor.

That is, StompHeaderAccessor is used exclusively for STOMP headers while SimpMessageHeaderAccessor is used for all messaging protocol headers, including STOMP.


STOMP is one of the simpler types of messaging protocol - it's text based, making it a little similar to how HTTP works and allows for communication using multiple languages and platforms. But it cannot be used for queuing and topics.

Further reading:

  1. http://jmesnil.net/stomp-websocket/doc/
  2. https://blogs.vmware.com/vfabric/2013/02/choosing-your-messaging-protocol-amqp-mqtt-or-stomp.html
like image 81
Ray Avatar answered Oct 27 '22 09:10

Ray