STOMP 协议 - 会话 ID 问题
来自 STOMP 1.0 协议描述(重点是我的):
客户端发送CONNECT后 框架,服务器将始终 通过发送确认连接 一个看起来像这样的框架:
<前><代码>已连接 会话:<会话ID> ^@session-id 标头是唯一的 此会话的标识符(尽管它 尚未实际使用)。
问题:
我假设连接后返回的
session-id
值对于 STOMP 客户端和代理之间的每个连接都是唯一的。然而,由于以上描述使用单独的术语“连接”和“会话”,因此情况不一定如此。是否有任何文档可以解释session-id
和服务器连接之间的关系,或者有人可以证实我的假设吗?是否有有关 session-id 值格式的文档?
我在谷歌上搜索这些问题的答案并没有透露任何有用的信息。我还尝试查看 ActiveMQ 5.4.2(我正在使用的代理)的源代码,但也没有找到任何明显的信息。
尽管问题 1 可能有点令人费解,但我计划将会话 ID 值用于客户的产品,并且确实更愿意了解而不是假设 STOMP 的行为方式。
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:
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 betweensession-id
and connections to the server or can someone confirm my assumption?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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
会话和连接被同等对待。每次连接时,ActiveMQ 为您提供的 session-id 标头将是一个全局唯一的 id。
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.