What is the major difference between SimpMessageHeaderAccessor vs StompHeaderAccessor Web Socket Spring?
Please explain elaborately if you know about this?
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.
public class SimpMessagingTemplate extends AbstractMessageSendingTemplate<String> implements SimpMessageSendingOperations. An implementation of SimpMessageSendingOperations . Also provides methods for sending messages to a user.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With