Search code examples
stomp

STOMP Protocol - Session ID Questions


From the STOMP 1.0 protocol description (emphasis mine):

After the client sends the CONNECT frame, the server will always acknowledge the connection by sending a frame which looks like:

CONNECTED
session: <session-id>

^@

session-id header is a unique identifier for this session (though it isn't actually used yet).

Questions:

  1. I would assume that the session-id value returned after connecting is unique for each connection between a STOMP client and broker. However, since the above description uses the separate terms "connection" and "session", this isn't necessarily the case. Is there any documentation to explain the relationship between session-id and connections to the server or can someone confirm my assumption?

  2. Is there any documentation available for the format of the session-id value?

My Google searching for answers to these questions didn't reveal any useful information. I also tried looking at the source code for ActiveMQ 5.4.2 (the broker I'm using), but didn't find any obvious information there either.

Although Question 1 is probably splitting hairs, I'm planning to use the session-id value for a customer's product and would really prefer to know rather than assume how STOMP behaves.


Solution

  • Session and Connection are being treated equally. The session-id header that ActiveMQ gives you will be a globally unique id every time you connect.