-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
None
At present, the affinity associated with a EJB SFSB or SLSB proxy is determined via one of two possible cases:
- if a PROVIDER_URL (or remote.connection equivalent) was specified in the JNDI environment, the bean will have URIAffinity where the associated URI matches the URI of the PROVIDER_URL
- if no PROVIDER_URL was specified, the bean will have Affinity.NONE
In order to obtain a bean with affinity other than URIAffinity or NONE, we have to specifically set the strong affinity after creating the bean, as in for example:
SomeBean bean = initialContext.lookup("ejb://app/module/distinct/SomeBean"); ClusterAffinity clusterAffinity = new ClusterAffinity("ejb"); EJBClient.setStrongAffinity(bean,clusterAffinity);
Three options were considered for providing a mechanism to set the affinity of a bean:
- Environment property e.g. env.put(EJBClient.CLUSTER_AFFINITY, "clusterName");
- Query string e.g. context.lookup("ejb:foo/bar/baz?cluster=clusterName");
- A special provider e.g. env.put(Context.PROVIDER_URL, "cluster:clusterName");
The first two options are sticky, in the sense that the affinity choice is tied tothe context as a whole; the latter permits assigning differing strong affinities to beans from the same context.
- blocks
-
JBEAP-9355 EJB cluster proxies are not failing over
- Closed