When using implicit endpoint selection, which is the case, because the jbi
endpoint
is not explicitely chosen (only by its service name), the NMR will choose
one endpoint
and send the exchange to it.
The default policy is to choose the first one (I think the order in which
they are declared is not
relevant here, because there is an unordered map somewhere).
This policy is pluggable and you can easily implement any policy you want.
See org.apache.servicemix.nmr.DefaultBroker#setDefaultServiceChooser.
You can also configure such a policy on the activationSpec for the component
that
send the exchange.
See org.apache.servicemix.jbi.container.ActivationSpec#setServiceChooser
Cheers,
Guillaume Nodet
On 7/25/06, bruce76 <[EMAIL PROTECTED]> wrote:
Ok, let me clarify (and please excuse me if I use the wrong terminology).
1. I have one component that sends a normailzed message to a service:
messageExchange.setService(new QName("http://www.abc.com", "receiver"));
2. I have two components that activate that service (however, they have
different endpoints):
// code in the 1st component
endpoint = context.activateEndpoint(new QName("http://www.abc.com",
"receiver"), "receiver1");
// code in the 2nd component
endpoint = context.activateEndpoint(new QName("http://www.abc.com",
"receiver"), "receiver2");
3. All three components are listed in my servicemix.xml file, and all
three
are instantiated and initialized. Now, the problem is that the 2nd
component
gets all the requests from the sender. If I comment the 2nd service out
from
the servicemix.xml then the 1st component gets all the requests.
I expected that the NMR would load balance and send requests to both
services. It's unfortunate to see that the LAST service that activates
under
the same service name get all the requests.
Thanks,
Bruce
--
View this message in context:
http://www.nabble.com/Does-the-NMR-perform-any-load-balancing--tf1994728.html#a5485323
Sent from the ServiceMix - User forum at Nabble.com.