On May 12, 2011, at 6:59 AM, Christian Koppen wrote:

> Dear OpenEJB users,
> 
> I'm trying to setup an OpenEJB (3.1.4) cluster of several nodes that host a 
> single application with a single stateless session bean.
> 
> I successfully configured the client to change the server node in case of a 
> node failure using the URL
> 
>  failover:round-robin:ejbd://localhost:10010,ejbd://localhost:10020
> 
> 
> Now what I actually want is that the client also changes the server node when 
> everything is OK - a simple form of load balancing. I thought this should be 
> the normal behavior, but I found out that once a client got a response from a 
> certain server, the client will not look for other servers ('sticky' 
> behavior).
> 
> I read the failover documentation [1] but didn't find anything useful. I also 
> found that using a EJB property 'openejb.client.connection.strategy' might 
> help [2]

I'll try and update that doc.

Meanwhile, try it as a System property on the client side before you open any 
connections.

You can also set it on the server side via an openejb-jar.xml in either of the 
properties buckets:

<openejb-jar>

  <properties>
     openejb.client.connection.strategy=random
  </properties>

  <ejb-deployment ejb-name="CalculatorImpl">
    <properties>
       openejb.client.connection.strategy=round-robin
    </properties>
  </ejb-deployment>

</openejb-jar>

In this case the properties are actually sent up to the client from the server 
and work in favor of any system level property.

So order of preference is:

  1. bean property (openejb-jar.xml)
  2. module property  (openejb-jar.xml)
  3. system property (client side system property)


-David


> , but I don't know where to set this property. Finally, I found that I could 
> implement a custom ConnectionStrategy [3] (which I don't really want to), but 
> didn't get this to work either.
> 
> I suppose that what I'm looking for is configuration on the client, not on 
> the server.
> 
> Can someone help out?
> 
> Thanks in advance,
> Christian
> 
> 
> [1] http://openejb.apache.org/3.0/failover.html
> [2] 
> http://mail-archives.apache.org/mod_mbox/openejb-dev/201005.mbox/%[email protected]%3E
> [3] https://issues.apache.org/jira/browse/OPENEJB-904

Reply via email to