JBoss Instance Configuration to Support Deployed EJB Client Contexts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(14 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[Remoting_WildFly_Subsystem_Configuration#Configuring_Remoting_Subsystem_to_Support_Deployed_EJB_Client_Contexts|Remoting Subsystem Configuration]]
* [[Remoting_WildFly_Subsystem_Configuration#Configuring_Remoting_Subsystem_to_Support_Deployed_EJB_Client_Contexts|Remoting Subsystem Configuration]]
* [[Session EJB and Servlet on Different JBoss Instances]]


=Relevance=
=Relevance=
Line 9: Line 10:
=Overview=
=Overview=


This article describes the server-side configuration required to support deployed EJB client contexts, as declared in [[Jboss-ejb-client.xml|jboss-ejb-client.xml]] deployment descriptors.
This article describes the server-side configuration required to support deployed EJB client contexts, as declared in [[Jboss-ejb-client.xml|jboss-ejb-client.xml]] deployment descriptors. Assuming that jboss-ejb-client.xml content is the one listed below, the following configuration changes are necessary:


=Remoting Subsystem Configuration=
<pre>
<jboss-ejb-client xmlns:xsi="urn:jboss:ejb-client:1.2" xsi:noNamespaceSchemaLocation="jboss-ejb-client_1_2.xsd">
    <client-context>
        <ejb-receivers>
            <remoting-ejb-receiver outbound-connection-ref="remote-ejb-container-1"/>
            <remoting-ejb-receiver outbound-connection-ref="remote-ejb-container-2"/>
        </ejb-receivers>
    </client-context>
</jboss-ejb-client>
</pre>
 
For more details about EJB client contexts, see {{Internal|EJB_Concepts#EJB_Client_Context|EJB client context}}


This section describes
For more details about jboss-ejb-client.xml, the deployment descriptor that configures the EJB client context, and which requires the above configuration changes, see {{Internal|Jboss-ejb-client.xml#Required_Server_Configuration|jboss-ejb-client.xml}}
 
=Procedure=
 
==Remoting Subsystem Configuration==
 
Declare remoting outbound connections corresponding to the "outbound-connection-ref" declared in the deployment descriptor:


EAP 7 configuration:
<pre>
<pre>
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
Line 30: Line 47:
             </properties>
             </properties>
         </remote-outbound-connection>
         </remote-outbound-connection>
        ...
     </outbound-connections>
     </outbound-connections>
     ...     
     ...     
</subsystem>
</subsystem>
</pre>
An "ejb" ApplicationRealm user will have to be created on each of the ''remote'' JBoss nodes we intend to invoke into. When asked if "is this new user going to be used for one AS process to connect to another AS process?", answer yes. The utility will provide the base-64 encoded credentials needed at the next step. The complete procedure is described here: {{Internal|Adding_Users_to_WildFly_Security_Realms#Add_a_User_to_the_Application_Realm|Adding a User to the Application Realm}}
We also need to declare a local "ejb-security-realm". The rationale and the procedure is describe here [[#Declare_a_Local_EJB_Security_Realm|Declare a Local EJB Security Realm]].
===xnio Options===
The outbound connections support the following options (declared as "properties"). These properties can be overridden from jboss-ejb-client.xml.
====SASL_POLICY_NOANONYMOUS====
====SSL_ENABLED====
==Declare a Local EJB Security Realm==
The local "ejb-security-realm" referred from remote-outbound-connections provides the credentials required to authenticate against the remote JBoss nodes. AS "secret value", use the hash generated at the previous step.


...
<pre>
<management>
    <security-realms>
        ...
        <security-realm name="ejb-security-realm">
            <server-identities>
                <secret value="ZWpiMTIz"/>
            </server-identities>
        </security-realm>
    </security-realms>
</management>
</pre>


==Declare the Corresponding Socket Bindings==
For each remote outbound connection, declare the corresponding outbound socket binding:
<pre>
<socket-binding-group ...>
<socket-binding-group ...>
     <outbound-socket-binding name="remote-ejb-container-socket-1">
     <outbound-socket-binding name="remote-ejb-container-socket-1">
         <remote-destination host="localhost" port="8180"/>
         <remote-destination host="1.2.3.4" port="8080"/>
     </outbound-socket-binding>
     </outbound-socket-binding>
    <outbound-socket-binding name="remote-ejb-container-socket-2">
        <remote-destination host="1.2.3.5" port="8080"/>
    </outbound-socket-binding>
  ...
</socket-binding-group>
</socket-binding-group>
</pre>
</pre>


where remote-outbound-connection's "name" attribute should match the remoting-ejb-receiver's outbound-connection-ref declared in jboss-ejb-client.xml. For more details about EJB client contexts, see [[EJB_Concepts#EJB_Client_Context|EJB client context]]. For more details about jboss-ejb-client.xml, the deployment descriptor that configures the EJB client context, and which requires the above configuration changes, see [[Jboss-ejb-client.xml#Required_Server_Configuration|jboss-ejb-client.xml]].
where remote-outbound-connection's "name" attribute should match the remoting-ejb-receiver's outbound-connection-ref declared in jboss-ejb-client.xml.
 
==Smoke Test==
 
Successful configuration and the deployment of an artifact that contains a jboss-ejb-client.xml descriptor generates logging similar to:
 
<pre>
17:00:34,344 INFO  [org.jboss.ejb.client.remoting] (default task-6) EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
17:00:34,350 INFO  [org.jboss.ejb.client.remoting] (MSC service thread 1-4) EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@445eed00, receiver=Remoting connection EJB receiver [connection=Remoting connection <2aeadb06> on endpoint "ejb-invoker" <59072952>,channel=jboss.ejb,nodename=ejb-container]} on channel Channel ID 9b500865 (outbound) of Remoting connection 77223769 to /127.0.0.1:8180 of endpoint "ejb-invoker" <59072952>
</pre>

Revision as of 21:06, 24 March 2017

Internal

Relevance

  • EAP 7.0.4

Overview

This article describes the server-side configuration required to support deployed EJB client contexts, as declared in jboss-ejb-client.xml deployment descriptors. Assuming that jboss-ejb-client.xml content is the one listed below, the following configuration changes are necessary:

<jboss-ejb-client xmlns:xsi="urn:jboss:ejb-client:1.2" xsi:noNamespaceSchemaLocation="jboss-ejb-client_1_2.xsd">
    <client-context>
        <ejb-receivers>
            <remoting-ejb-receiver outbound-connection-ref="remote-ejb-container-1"/>
            <remoting-ejb-receiver outbound-connection-ref="remote-ejb-container-2"/>
        </ejb-receivers>
    </client-context>
</jboss-ejb-client>

For more details about EJB client contexts, see

EJB client context

For more details about jboss-ejb-client.xml, the deployment descriptor that configures the EJB client context, and which requires the above configuration changes, see

jboss-ejb-client.xml

Procedure

Remoting Subsystem Configuration

Declare remoting outbound connections corresponding to the "outbound-connection-ref" declared in the deployment descriptor:

<subsystem xmlns="urn:jboss:domain:remoting:3.0">
    ...
    <outbound-connections>
        <remote-outbound-connection name="remote-ejb-container-1" 
                                    outbound-socket-binding-ref="remote-ejb-container-socket-1" 
                                    username="ejb" 
                                    security-realm="ejb-security-realm" 
                                    protocol="http-remoting">
            <properties>
                <property name="SASL_POLICY_NOANONYMOUS" value="false"/>
                <property name="SSL_ENABLED" value="false"/>
            </properties>
        </remote-outbound-connection>
        ...
    </outbound-connections>
    ...    
</subsystem>

An "ejb" ApplicationRealm user will have to be created on each of the remote JBoss nodes we intend to invoke into. When asked if "is this new user going to be used for one AS process to connect to another AS process?", answer yes. The utility will provide the base-64 encoded credentials needed at the next step. The complete procedure is described here:

Adding a User to the Application Realm

We also need to declare a local "ejb-security-realm". The rationale and the procedure is describe here Declare a Local EJB Security Realm.

xnio Options

The outbound connections support the following options (declared as "properties"). These properties can be overridden from jboss-ejb-client.xml.

SASL_POLICY_NOANONYMOUS

SSL_ENABLED

Declare a Local EJB Security Realm

The local "ejb-security-realm" referred from remote-outbound-connections provides the credentials required to authenticate against the remote JBoss nodes. AS "secret value", use the hash generated at the previous step.

<management>
    <security-realms>
        ...
        <security-realm name="ejb-security-realm">
            <server-identities>
                <secret value="ZWpiMTIz"/>
            </server-identities>
        </security-realm>
    </security-realms>
</management>

Declare the Corresponding Socket Bindings

For each remote outbound connection, declare the corresponding outbound socket binding:

<socket-binding-group ...>
    <outbound-socket-binding name="remote-ejb-container-socket-1">
        <remote-destination host="1.2.3.4" port="8080"/>
    </outbound-socket-binding>
    <outbound-socket-binding name="remote-ejb-container-socket-2">
        <remote-destination host="1.2.3.5" port="8080"/>
    </outbound-socket-binding>
   ...
</socket-binding-group>

where remote-outbound-connection's "name" attribute should match the remoting-ejb-receiver's outbound-connection-ref declared in jboss-ejb-client.xml.

Smoke Test

Successful configuration and the deployment of an artifact that contains a jboss-ejb-client.xml descriptor generates logging similar to:

17:00:34,344 INFO  [org.jboss.ejb.client.remoting] (default task-6) EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
17:00:34,350 INFO  [org.jboss.ejb.client.remoting] (MSC service thread 1-4) EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@445eed00, receiver=Remoting connection EJB receiver [connection=Remoting connection <2aeadb06> on endpoint "ejb-invoker" <59072952>,channel=jboss.ejb,nodename=ejb-container]} on channel Channel ID 9b500865 (outbound) of Remoting connection 77223769 to /127.0.0.1:8180 of endpoint "ejb-invoker" <59072952>