English 中文(简体)
我应该取消订阅不可持续 JMS 主题订阅者吗?
原标题:Should I unsubscribe a non-durable JMS Topic subscriber?

I 正在撰写一个 Java JMS 应用程序,该应用程序负责集节点之间的互通。 消息是通过使用主题发布订阅完成的。 主题订阅者是用调用 Topic Session. 创建的。 创建用户( 专题、 无效、 真实), 意思是它不是一个耐久的订阅者。 现在我正在实施一项“ 释放” 方法, 它将取消订阅( 并关闭连接等) 。 我看到Topic Session. unsublication( 名字) 只与耐久的订阅者有关, 因此我如何取消一个不耐久的订阅? 是否必要?

问题回答

否, 您不需要为不可保存的订阅发行 < code> Topic Session. unsublication () 。 关闭消费者会将订阅从 JMS 提供商中删除。 您也可以使用 < code > System. Close () 或 Connection. close () 来取消订阅。 Close () 将订阅从 JMS 提供商中删除。

在您的 releasure 方法中,只需关闭订阅者或会话或连接。

只对耐用订阅要求取消订阅。





相关问题
How to optimize activemq

I m using ActiveMQ on a simulation of overloading servers in Java. And mainly it goes ok, but when I get over 600 requests the thing just go WTF! I think the bottleneck is my Master Server which is ...

Does Pentaho Kettle have a way to accept JMS messages?

Does Pentaho s ETL system, Kettle (http://kettle.pentaho.org/) have a plugin to accept information from JMS messages? I d like to set up a job that can read messages each containing a hash, extract ...

post message to a remote JMS provider

I want to be able to send messages to a remote JBoss server (JBoss MQ). I can do it for a local one but i m stuck when trying with a remote one. can anyone explain to me how to do it ? are there any ...

PostgreSQL and JMS (Or other Pub-Sub/Callback Mechanism)

I want to have my PostgreSQL server send out notifications when a piece of data changes, preferably over JMS, but also considering any other Pub-Sub mechanism or Callback. Any ideas if this is ...

ActiveMQ Consumer / Producer Connection Listener

I can t seem to find a way to listen for new producer and consumer connections (or connection interrupts) in ActiveMQ (Java Version). I want to be able to tell the consumers (or they can find out ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

热门标签