简体   繁体   English

各种jms提供程序实例之间的负载分配

[英]load distributon between various jms provider instances

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. 在上述情况下,可以说有“ N”个生产者试图在我们的(消费者的)JMS队列中放入很多消息。

My question is how does the load distribution work in the JMS environments specifically with queues. 我的问题是负载分配如何在JMS环境中特别是在队列中工作。

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. 我认为JNDI在这种情况下提供了足够的间接性,因此所有客户端都只是在查找一些基于JNDI的队列和连接工厂。 And any kind of loadDistributor could sit in the between the consumer and the producer to take the incoming messages. 任何种类的loadDistributor都可以位于使用者和生产者之间以接收传入的消息。

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. 它如何将这些传入消息分发到JMS提供程序的服务器场(我认为我们需要它们的服务器场来处理传入流量),然后又如何维护多个队列的同步副本..还是让任何消息进入任何队列,然后使用MDB对其进行处理。 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 ? 对于这种“高负载”环境,推荐的方法是什么?

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 eg 2 MBDs listening on the queue, they will each take a message in turn work on it and then get the next one. 因此,例如,如果您有2个MBD正在队列中监听,它们将依次接收一条消息,然后再处理下一条。

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. 我可能不完全了解您要寻找的内容,但是第一手的是,您需要一个JMS提供程序(“消息传递中心”)来公开一个队列,其中多个MDB(可以驻留在不同的主机上)将从中选择消息。 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM