一个 JMS 主题是否可以有多个发布者?
从我到目前为止所读到的内容来看,JMS 主题是一对多,我想知道是否可以使用主题支持多对多。考虑一个名为“报告”的主题,其中多个服务分布在需要发布计划报告的企业中。拥有多个发布者将减少为每个报告服务订阅感兴趣的应用程序的主题的需要。
From what I've read so-far, a JMS Topic is 1-to-Many and I wonder if its possible to support Many-to-Many using a topic. Consider a topic called "Reports" with multiple services spread out across an enterprise needing to publish scheduled reports. Having multiple publishers would alleviate the need to subscribe interested applications to a topic for each of the reporting services.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
@Mondain:是的,很有可能。一个实际的例子是由多个来源提供的实时股票市场价格反馈以及由多个渠道消耗的反馈。
@Mondain: yes, very much possible. A practical example would be live stock market price feed provided by multiple sources and those feed consumed by multiple channels.
是的,您可以从
TopicSession
创建多个TopicPublisher
,并且许多应用程序可以使用TopicPublisher
连接同一个Topic
或主题订阅者
。Yes, you can create many
TopicPublisher
from yourTopicSession
, and many applications can connect the sameTopic
usingTopicPublisher
orTopicSubscriber
.您可以执行类似的操作,并调用 CreateMessageProducer 在应用程序中的任何位置创建生产者的新实例。
You can do something like this, and call
CreateMessageProducer
to create a new instance of producer anywhere in your application.