We have several severs differentiated by an ID. For asynchronous communications a selector (filter) with the ID will direct the message to the correct server/MDB. For synchronous communications to a stateless session bean, I have suggested a dynamic lookup strategy where deployment descriptors "override" the EJB name.
From java client:
@Inject private void setSessionContext(SessionContext ctx) {
this.ctx = ctx
}
String myID = "1234";
myShoppingCart = (ShoppingCart)ctx.lookup(“shoppingCart" + myID);
@EJB(name="shoppingCart")
On each server:
shoppingCart
shoppingCart1234
Is there another strategy which I should be considering for client lookup of the "correct" server session bean handler?