jakarta-eeejbcross-server

Sending data from EJB server to another EJB server


enter image description here

I have to send data from P1 et P2 and P3 till reaching the 4th machine P4 which contains 2 EJBs. I don't know how to send data from EJB3A to EJB3B. Can a server be a client too?


Solution

  • The server can, of course, be a client, too.

    I guess P3, in the end, is calling EJB3A. If EJB3A andEJB3B are deployed within the same JBoss server, you can use EJB injection to delegate to EJB3B or lookup the EJB. If EJB3B is deployed to another JBoss server instance, you have two options: if EJB3B is clustered, you can use injection or lookup like above. If not, you can still lookup EJB3B like an ordinary remote client would do, using the adress and port and the remote view of the other JBoss server and EJB.