...
Panel |
---|
./geronimo.sh run --long -Dopenejb.client.requestretry=true |
Developing the client
EJB clients must know the address of EJB members to make sure that its request will be handled with high availability regardless EJB members are clustered in Multipoint or Multicast way.
...
Section |
---|
Column |
---|
| Code Block |
---|
|
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
p.setProperty(Context.PROVIDER_URL,"multicast://239.255.3.2:6142?group=cluster1");
...
|
|
Column |
---|
| Code Block |
---|
title | URI for Multipoint/Unicast |
---|
|
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
p.setProperty(Context.PROVIDER_URL,"failover:ejbd://ejbd://foo:4201");
...
|
|
|
failover strategies
OpenEJB supports 3 kinds of failover strategies for failover when the original node was shutdown abnormally.
...
Code Block |
---|
| sticky |
Properties p = new Properties();
p.setProperty(Context.PROVIDER_URL,"failover:round-robin:ejbd://foo:4201, ejbdejbds://bar:4201,multicast://239.255.2.3:6142");
...
|
Section |
---|
Column |
---|
| Code Block |
---|
|
Properties p = new Properties();
p.setProperty(Context.PROVIDER_URL,"failover:round-robin:ejbd://foo:4201,ejbdsejbd://bar:4201,multicast://239.255.2.3:6142");
...
|
| column |
Column |
---|
| 30% | Code Block |
---|
|
Properties p = new Properties();
p.setProperty(Context.PROVIDER_URL,"failover:random:ejbd://foo:4201,ejbd://bar:4201");
...
|
|
|
...
Starting from Geronimo 2.2.12, unicast-based support is provided. WADI can be configured to use unicast instead of multicast to support failover for Stateless Session Bean.
...