适用于大量主题订阅者的 JMS 会话池

发布于 2024-08-30 14:11:49 字数 240 浏览 2 评论 0原文

我正在编写一个应用程序,它将创建大量 JMS 主题订阅者。关于重用会话的最佳实践是什么?

每个订阅者一个会话?会话池?对于每个订阅者一个会话,线程数似乎不合理。这是类似 ServerSessionPool 之类的工作吗?到目前为止我所看到的似乎表明 ServerSessionPool 更适合一个接收者同时消费消息,而不是大量接收者。

我目前正在使用嵌入在 JBoss EAP 4.3.0CP6 中的 HornetQ 2.0.0GA。

I'm writing an app that will create lots of JMS topic subscribers. What is best practise regarding reusing sessions?

A session per subscriber? A pool of sessions? With a session per subscriber the thread count seems unreasonable. Is this a job for something like a ServerSessionPool? What I've seen so far seems to suggest that ServerSessionPool is more geared towards one receiver consuming messages concurrently rather than lots of receivers.

I'm currently working with HornetQ 2.0.0GA embedded in JBoss EAP 4.3.0CP6.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪痕残 2024-09-06 14:11:49

您很可能需要许多会话,因为会话是针对每个线程的。这里有一个链接,指向一个非常好的 Stack Overflow 响应,其中解释了上下文。

万一您的 JMS 主题订阅都在同一个线程中,请注意,如果是事务处理会话,它们也将共享相同的工作单元。

Most likely you will need many sessions since a session is per-thread. Here's a link to a really good Stack Overflow response that explains the context.

In the unlikely event that your JMS topic subscriptions are all within the same thread, note that they will all also share the same unit of work if its a transacted session.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文