如何以编程方式创建带有 hornet q 的主题?
我一直在查看 org.hornetq.core.server 包,它似乎具有与管理服务器相关的最有趣的低级 API。
服务器会话有一些标记为队列的方法,但没有一个包含主题...
ServerSession
void createQueue(SimpleString address,
SimpleString name,
SimpleString filterString,
boolean temporary,
boolean durable) throws Exception;
void deleteQueue(SimpleString name) throws Exception
接口 QueueFactory
Queue createQueue(long persistenceID,
final SimpleString address,
SimpleString name,
Filter filter,
boolean durable,
boolean temporary);
但是我不知道如何创建主题。我是否遗漏了作为队列实现的 JMS 主题?
I have been looking at the org.hornetq.core.server package which seems to have the most interesting low level APIS relating to managing the server.
The server session has a few methods labelled something Queue but none include Topic ...
ServerSession
void createQueue(SimpleString address,
SimpleString name,
SimpleString filterString,
boolean temporary,
boolean durable) throws Exception;
void deleteQueue(SimpleString name) throws Exception
interface QueueFactory
Queue createQueue(long persistenceID,
final SimpleString address,
SimpleString name,
Filter filter,
boolean durable,
boolean temporary);
However i could not figure out how to create a topic. Am i missing something is a JMS topic implemented as a queue ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
核心 API 不知道 JMS 中使用的主题的概念,它只知道队列和地址。在文档 它说:
*例如,JMS 主题将由绑定许多队列的单个地址实现。每个队列代表该主题的一个订阅。 JMS 队列将被实现为绑定一个队列的单个地址 - 该队列代表 JMS 队列。*
您可以以相同的方式使用核心 API 来实现它,或者只使用 JMS :-)
The core API does not know the concept of a Topic as it is used in JMS, it only knows queues and adresses. In the documentation it says:
*For example, a JMS topic would be implemented by a single address to which many queues are bound. Each queue represents a subscription of the topic. A JMS Queue would be implemented as a single address to which one queue is bound - that queue represents the JMS queue.*
You could implement it with the core API the same way or just use JMS :-)