EJB invocations for deployed applications using remote-interface will not stay local for EAP 7.2 server
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.1 ... 7.2.3
Issue
- EAP 6 and 7.0 will keep EJB invocations bound to the local node even if the remote interface is used as long as the EJB is deployed local and it is not excluded within the jboss-ejb-client.xml
- Invocation of a remote EJB are using instances in a cluster in a random manner after we migrate from 7.0 to 7.2, for legacy versions it was keept in the same instance
- If an application is deployed inside of EAP (7.0) which invoke another EJB via remote interface the invocation will use always the local deployed application (if available) by default. After migration to EAP 7.2 the invocation will be random to instances where the application is available. This is unexpected as the jboss-ejb-client.xml only allows to exclude the local-receiver but the local invocation is faster as we have configured the invocation by reference.
Resolution
The issue has been addressed with Content from issues.jboss.org is not included.JBEAP-17344 and will be fixed in a future CP.
Also an enhancement to use the default implementations provided by the ejb-client libraries Content from issues.jboss.org is not included.WFLY-12364 will be implemented.
As a workaround the jboss-ejb-client.xml can be used together with the attached example to prefer the local instance.
<jboss-ejb-client xmlns="urn:jboss:ejb-client:1.2">
<client-context deployment-node-selector="org.jboss.ejb.client.LocalEJBReceiverPreferringNodeSelector">
<ejb-receivers>
<remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection"/>
</ejb-receivers>
<clusters>
<cluster name="ejb" cluster-node-selector="org.jboss.ejb.client.LocalEJBReceiverPreferringNodeSelector"/>
</clusters>
</client-context>
</jboss-ejb-client>
Root Cause
The implementation has changed substiantially and the former versions include an internal server side implementation (org.jboss.as.ejb3.remote.LocalEJBReceiverPreferringDeploymentNodeSelector.java) which prefers the local instance if possible.
Due to the change for ejb-client from 7.1 onwards this has been replaced by default implementations of DeploymentNodeSelector and ClusterNodeSelector which does not check this. Therefore the invocations are spread to all/some nodes and does not stay local.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.