Clustered EJBs not being balanced in JBoss AS 7

前端 未结 1 1649
礼貌的吻别
礼貌的吻别 2021-02-10 17:11

I\'ve successfully setup a cluster of 2 JBoss AS 7 instances, and deployed the following SLSB:

@Stateless
@Remote(TestEJBRemote.class)
@Clustered
public class T         


        
相关标签:
1条回答
  • 2021-02-10 17:23

    It looks like you need to specify both servers in the properties building. Also it looks like there was a but in JBoss 7.1 so you should be using at least 7.2, check this link where the following sample was taken from:

    Properties properties = new Properties();
    properties.put("endpoint.name", "farecompare-client-endpoint");
    properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
    properties.put("remote.connections", "cmc5101,cmc5102");
    properties.put("remote.connection.cmc5101.host", "cmc5-101");
    properties.put("remote.connection.cmc5101.port", "4447");
    properties.put("remote.connection.cmc5101.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
    properties.put("remote.connection.cmc5102.host", "cmc5-102");
    properties.put("remote.connection.cmc5102.port", "4447");
    properties.put("remote.connection.cmc5102.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
    PropertiesBasedEJBClientConfiguration configuration = new PropertiesBasedEJBClientConfiguration(properties);
    final ContextSelector ejbClientContextSelector = new ConfigBasedEJBClientContextSelector(configuration);
    final ContextSelector previousSelector = EJBClientContext.setSelector(ejbClientContextSelector);
    final Hashtable jndiProperties = new Hashtable();
    jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
    final Context context = new InitialContext(jndiProperties);
    

    Also this link might be helpful. Another useful link.

    0 讨论(0)
提交回复
热议问题