You need to set the policy either on the activationSpec
for the component that send the exchange.
You can also set the global policy on the broker.

<sm:activationSpec ..>
 <sm:serviceChooser>
   <bean class="org.apache.servicemix.jbi.resolver.RandomChoicePolicy" />
 </sm:serviceChooser>
 ..
</sm:activationSpec>

change the tag to <sm:interfaceChooser/> if the component use interfaces
to address the target.

On the broker, something like the following should work:
 <sm:container ...>
   <sm:broker>
     <bean class="org.apache.servicemix.jbi.nmr.DefaultBroker">
       <property name="defaultServiceChooser">
         <bean class="org.apache.servicemix.jbi.resolver.RandomChoicePolicy" />
       </property>
     </bean>
   </sm:broker>
   ...
 </sm:container>

Though for load-balancing across several JBI containers / processes,
using a jms flow, or a plain jms queue would work better imho ...

On 12/11/06, Tom <[EMAIL PROTECTED]> wrote:
Hello all,

I'm currently trying to use two services (both the same) to do some load
balancing tests, but I can't seem to enable the RandomChoicePolicy.  Has
anybody some experience with this? And if so, could you post a small
code snippet with some explanation?

Thanks in advance,
Tom



--
Cheers,
Guillaume Nodet

Reply via email to