[jboss-user] [JBoss Remoting] - Re: Is it possible to influence which EJB is called (remote / local)?

jaikiran pai do-not-reply at jboss.com
Thu Sep 6 05:21:58 EDT 2012


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/jboss/as/ejb3/remote/LocalEJBReceiverPreferringDeploymentNodeSelector.java#L31 https://github.com/jbossas/jboss-as/blob/master/ejb3/src/main/java/org/jboss/as/ejb3/remote/LocalEJBReceiverPreferringDeploymentNodeSelector.java#L31.

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/basic/src/test/java/org/jboss/as/test/integration/ejb/client/descriptor/jboss-ejb-client_1_2.xml#L24 https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/client/descriptor/jboss-ejb-client_1_2.xml#L24
--------------------------------------------------------------

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&containerType=14&container=2050]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120906/28a353bc/attachment.html 


More information about the jboss-user mailing list