jaikiran pai [
https://community.jboss.org/people/jaikiran] created the discussion
"Re: Is it possible to influence which EJB is called (remote / local)?"
To view the discussion, visit:
https://community.jboss.org/message/758251#758251
--------------------------------------------------------------
Adriaan, welcome to the forums :)
Adriaan Wisse wrote:
But... somehow at the moment we are facing the problem that it is not default behaviour
that when the same EJB can be found locally and remote it will prefer the local EJB above
the remote one. Is this some configuration option or something that we can influence
programmatically?
Yes, there's a server side implementation of
DeploymentNodeSelector which "prefers" the local server if there are multiple
servers which can handle that EJB. There are reasons to do that since if the local server
can handle the request there's no need to do the expensive network calls on the remote
server. This is the implementation which routes it to the local node
https://github.com/jbossas/jboss-as/blob/master/ejb3/src/main/java/org/jb...
https://github.com/jbossas/jboss-as/blob/master/ejb3/src/main/java/org/jb....
If you want to override that behaviour then you can implement your own
DeploymentNodeSelector (which selects and returns appropriate node) and then package a
jboss-ejb-client.xml in the application and set the deployment-node-selector attribute
value to that class name. Here's an example of the xml
https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/bas...
https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/bas...
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/758251#758251]
Start a new discussion in JBoss Remoting at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]