Change Port Injection with JBoss
This topic has not yet been written. The content below is from the topic description.
2.2 Port Injection with JBoss To change the default ports by a fixed offset amount, use the -Djboss.service.binding.set flag during startup, passing it ports-01, ports-02, or ports-03. ie: ./run.sh -c node2 -g ClusterGroup -u 239.255.100.100 -b 127.0.0.1 -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-01 This flag increments all ports by a fixed amount. Ports-01 increments all ports by 100, ports-02 increments by 200, and ports-03 increments by 300. Again, this is the simplest approach as well as the safest – no worries about fat fingering a port in a long xml file. This is all you need to do. In the event you want to add more incremental values or change the increment amount, you can achieve by modifying the bindings-jboss-beans.xml found in jboss-eap-5.1/jboss-as/ /all/conf/bindingservice.beans/META-INF/ Where is all, default, minimal, production, standard, web, or your own custom configuration. Inside this file there are two sections of interest – where the bindings are identified and where the bindings are defined. Illustration 1: port increment definitions in bindings-jboss-beans.xml located at jboss-eap-5.1/jboss-as//all/conf/bindingservice.beans/META-INF/ The section above shows the identification of the port increment offerings. If you want to add additional definitions, you would start by defining that bean here. For example, if you want to add a ‘ports04Bindings’ where we can pass in ports-04 for a 400 increment to our ports, we would start by adding that identification here: Illustration 2: Adding port increment definitions in bindings-jboss-beans.xml located at jboss-eap-5.1/jboss-as//all/conf/bindingservice.beans/META-INF/ The other section in this file of interest is where we actual define what these beans mean. For example, if we look at the definition for Ports01Bindings, we see the following: Illustration 3: Configuration for ports-01 in bindings-jboss-beans.xml located at jboss-eap-5.1/jboss-as//all/conf/bindingservice.beans/META-INF/ In this definition, if all we are looking to do is change the offset, then we modify the third parameter accordingly. Continuing our previous example, lets add the rest of the definition for Port04Bindings, which will use ports-04 in the -D flag: Illustration 4: Adding port increment configuration for ports-04 in bindings-jboss-beans.xml located at jboss-eap-5.1/jboss-as//all/conf/bindingservice.beans/META-INF/ Just that simple. Now if we wanted to use port-04 in our startup script, we could : ./run.sh -c node2 -g ClusterGroup -u 239.255.100.100 -b 127.0.0.1 -Djboss.messaging.ServerPeerID=2