Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EJBCLIENT-234] Provide JNDI environment property to assign cluster affinity. #276

Merged
merged 1 commit into from
May 22, 2017

Conversation

rachmatowicz
Copy link
Contributor

This PR adds a JNDI environment property to allow a user to specify that all proxies created from the InitialContext will have strong affinity to the cluster named in the property.

See https://issues.jboss.org/browse/EJBCLIENT-234 for more details.

@@ -64,6 +64,11 @@ private EJBClient() {
public static final String SOURCE_ADDRESS_KEY = "jboss.source-address";

/**
* A JNDI context key which, if defined, identifies that the proxy to be created should have affinity to the cluster.
*/
public static final String CLUSTER_AFFINITY = "cluster-affinity";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can merge this as an interim commit, but this property should be qualified with "jboss.", and...

// check if strong affinity for this proxy has been set in the environment
URI clusterAffinity = getClusterAffinityURIFromEnvironment();
if (clusterAffinity != null) {
affinity = Affinity.forUri(clusterAffinity);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...this should accept a cluster name, not a URI, and use the (public) ClusterAffinity(String) constructor.

@rachmatowicz
Copy link
Contributor Author

I'll fix them now.

@dmlloyd dmlloyd merged commit 6d96bc2 into wildfly:master May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants