各种 jms 提供程序实例之间的负载分布
生产者<-->消费者
在上面的场景中,假设有“N”个生产者试图将大量消息放入我们(消费者)的 JMS 队列中。
我的问题是负载分配在 JMS 环境中如何工作,特别是在队列中。
我认为 JNDI 在这种情况下提供了足够的间接性,因此所有客户端都只是查找一些基于 JNDI 的队列和连接工厂。任何类型的 loadDistributor 都可以位于消费者和生产者之间来获取传入的消息。
它如何将这些传入消息分发到 JMS 提供程序场(我认为我们需要一个它们的场来处理传入流量),但是如何维护多个队列的同步副本..或者让任何消息进入任何队列并使用 MDB 对其进行处理。但是如何保证“消息将按照接收顺序进行处理”,因为它们都分布在一堆队列中......
这种“高负载”环境的推荐方法是什么?
Producers <--> Consumer
In the above scenario there are lets say 'N' number of producers trying to put a lot of messages in our (Consumer's) JMS queues.
My question is how does the load distribution work in the JMS environments specifically with queues.
I think the JNDI provides sufficient indirection in this case, so all the clients are just looking up some JNDI based queue and connection factory. And any kind of loadDistributor could sit in the between the consumer and the producer to take the incoming messages.
how does it distribute those incoming messages to a farm of JMS providers ( i think we need a farm of them to handle the incoming traffic) but then how do you maintain the synchronized copies of multiple queues.. or do you let any message go into any queue and just process it using MDBs. but how do you guarantee that the 'messages will be processed in the order in which they are received" coz they are all distributed in a bunch of queues...
What is the recommended approach for this kind of 'high-load' environments ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
队列本质上是“串行”的,其中的消息将被传送到一个接收者。因此,如果您有 2 个 MBD 监听队列,它们将依次接收一条消息并对其进行处理,然后获取下一条消息。
对于传入的消息,您只需将它们依次放入队列中即可。
我可能不完全理解你在研究什么,但从第一手资料来看,
您需要一个 JMS 提供程序(“消息传递中心”)来公开一个队列,多个 MDB(可以驻留在不同的主机上)将从中选取消息。
A queue is 'serial' in nature in a way that the messages in it will each be delivered to one receiver. So if you have e.g 2 MBDs listening on the queue, they will each take a message in turn work on it and then get the next one.
For incoming messages, you just put them into the queue one after each other.
I may not completely understand what you are looking into, but it looks at first hand, that
you need one JMS provider ("messaging hub") that exposes one queue where multiple MDBs (which can live on different hosts) will pick the messages from.