-
1. Re: How to lookup ejb in cluster on specific node
tibu Dec 4, 2014 11:55 AM (in response to tibu)Just wondering, is it even possible to lookup a ejb on a specific node in the cluster?
We do this on one node, to look up ejb proxy on another node:
Properties prop = new Properties();
prop.put("remote.connections", "ejb");
prop.put("remote.connection.ejb.host", host);
prop.put("remote.connection.ejb.port", port);
prop.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
prop.put("remote.connection.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
prop.put("org.jboss.ejb.client.scoped.context", "true");
InitialContext ct = new InitialContext(prop);
Object res = ct.lookup(jndiName);
This always returns a proxy for the current node not the remote one. We were hoping, that the scoped.context would serve exactly this purpose?
Is there a known bug with this in 7.2.0.Final?
-
2. Re: How to lookup ejb in cluster on specific node
wdfink Dec 4, 2014 4:59 PM (in response to tibu)What you try to do? Lookup a remote EJB inside of an EJB?
A scoped context has several issues, i.e. you need to use *.close() after use otherwise you will run into a connection leak.
Could you describe what you try to achieve?
-
3. Re: How to lookup ejb in cluster on specific node
tibu Dec 5, 2014 3:21 AM (in response to wdfink)Hi,
we want to achieve this:
- "Mark" one node of the cluster as master using a HA SingletonService as described in the cluster-ha-singleton quickstart
- Deploy our former cluster singletons as node singletons
- Use only the node singleton on the "master" by checking on which node the service is running
So this is what we do:
1) have the service running and returning its ip, port and node
2) access it through a regular SLSB via injection
3) ask this SLSB for the master connection (ip/port/node)
4) connect to the desired node singleton on the cluster node returned by our master service
We are struggeling with step 4, which we are trying to solve as described before. The problem is this:
- Cluster with two nodes (A) and (B)
- (B) is started first and running our master service
- (A) wants to access a singleton and acquires the connection information from (B)
- When we construct a InitialContext with this information, the lookup returns a proxy for the singleton on (A)
We tried to disable mod-cluster by setting a simple load provider and by completly removing the subsystem configurations, but had no success.
We also tried multiple variations of properties, but as far as I know, thos that I posted before should be the right ones...
Any hint/link/guide would be awesome,
Tibu
-
4. Re: How to lookup ejb in cluster on specific node
tibu Dec 9, 2014 3:27 AM (in response to wdfink)We now switched to Wildfly 8.2.0 but the behavior is still the same. If anybody sees our error here or has some suggestion, please let me know!