Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ under the License.
<configuration>
<ignore>${noServer}</ignore>
<instance>${basedir}/target/server0</instance>
<clustered>true</clustered>
<staticCluster>tcp://localhost:61617,tcp://localhost:61618</staticCluster>
<args>
<arg>--queues</arg>
<arg>exampleQueue</arg>
Expand All @@ -78,7 +78,7 @@ under the License.
<configuration>
<ignore>${noServer}</ignore>
<instance>${basedir}/target/server1</instance>
<clustered>true</clustered>
<staticCluster>tcp://localhost:61616,tcp://localhost:61618</staticCluster>
<portOffset>1</portOffset>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
Expand All @@ -100,7 +100,7 @@ under the License.
<configuration>
<ignore>${noServer}</ignore>
<instance>${basedir}/target/server2</instance>
<clustered>true</clustered>
<staticCluster>tcp://localhost:61616,tcp://localhost:61618</staticCluster>
<portOffset>2</portOffset>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ This example demonstrates how connections created from a single JMS Connection f

The particular load-balancing policy can be chosen to be random, round-robin or user-defined. Please see the user guide for more details of how to configure the specific load-balancing policy. In this example we will use the default round-robin load balancing policy.

The list of servers over which Apache Artemis will round-robin the connections can either be specified explicitly in the connection factory when instantiating it directly, when configuring it on the broker or configured to use UDP discovery to discover the list of servers over which to round-robin. This example will use UDP discovery to obtain the list.
The list of servers over which Apache Artemis will round-robin the connections can either be specified explicitly in the connection factory when instantiating it directly, when configuring it on the broker or configured to use server discovery to discover the list of servers over which to round-robin. This example will specify explicitly the list of servers.

This example starts three servers which all broadcast their location using UDP discovery. The UDP broadcast configuration can be seen in the `broker.xml` file.
This example starts three servers. The configuration can be seen in the `broker.xml` file.

A JMS ConnectionFactory is deployed on each broker specifying the discovery group that will be used by that connection factory.
A JMS ConnectionFactory is deployed on each broker specifying the list of servers.

For more information on Apache Artemis load balancing, and clustering in general, please see the clustering section of the user manual.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# under the License.

java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
connectionFactory.ConnectionFactory=udp://231.7.7.7:9876
connectionFactory.ConnectionFactory=(tcp://localhost:61616,tcp://localhost:61617,tcp://localhost:61618)
queue.queue/exampleQueue=exampleQueue
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,10 @@ under the License.
</goals>
<configuration>
<ignore>${noServer}</ignore>
<clustered>true</clustered>
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<args>
<arg>--cluster-user</arg>
<arg>my-cluster-user</arg>
<arg>--cluster-password</arg>
<arg>my-cluster-password</arg>
</args>
</configuration>
</execution>
<execution>
Expand All @@ -76,18 +69,11 @@ under the License.
</goals>
<configuration>
<ignore>${noServer}</ignore>
<clustered>true</clustered>
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<portOffset>1</portOffset>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<args>
<arg>--cluster-user</arg>
<arg>my-cluster-user</arg>
<arg>--cluster-password</arg>
<arg>my-cluster-password</arg>
</args>
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
</configuration>
</execution>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ The cli create method will define a similar section by default if you use `--clu
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>STRICT</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
<static-connectors>
<connector-ref>server1-connector</connector-ref>
</static-connectors>
</cluster-connection>

For more information on Apache Artemis load balancing, and clustering in general, please see the "Clusters" chapter of the user manual.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61616</connector>
<connector name="server1-connector">tcp://localhost:61617</connector>
</connectors>

<!-- Acceptors -->
Expand All @@ -40,23 +41,6 @@ under the License.
</acceptors>

<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>

<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>

<cluster-user>my-cluster-user</cluster-user>
<cluster-password>my-cluster-password</cluster-password>

Expand All @@ -67,7 +51,9 @@ under the License.
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>STRICT</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
<static-connectors>
<connector-ref>server1-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61617</connector>
<connector name="server0-connector">tcp://localhost:61616</connector>
</connectors>

<!-- Acceptors -->
Expand All @@ -39,23 +40,6 @@ under the License.
</acceptors>

<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broacast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>

<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>

<cluster-user>my-cluster-user</cluster-user>
<cluster-password>my-cluster-password</cluster-password>

Expand All @@ -66,7 +50,9 @@ under the License.
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>STRICT</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
<static-connectors>
<connector-ref>server0-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ under the License.

<connectors>
<connector name="netty-connector">tcp://localhost:61616</connector>
<connector name="server1-connector">tcp://localhost:61617</connector>
<connector name="server2-connector">tcp://localhost:61618</connector>
</connectors>

<!-- Acceptors -->
Expand All @@ -41,22 +43,6 @@ under the License.
</acceptors>

<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>

<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>

<cluster-user>my-cluster-user</cluster-user>
<cluster-password>my-cluster-password</cluster-password>
Expand All @@ -68,7 +54,10 @@ under the License.
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>STRICT</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
<static-connectors>
<connector-ref>server1-connector</connector-ref>
<connector-ref>server2-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61617</connector>
<connector name="server0-connector">tcp://localhost:61616</connector>
<connector name="server2-connector">tcp://localhost:61618</connector>
</connectors>

<!-- Acceptors -->
Expand All @@ -40,22 +42,6 @@ under the License.
</acceptors>

<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>

<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>

<cluster-user>my-cluster-user</cluster-user>
<cluster-password>my-cluster-password</cluster-password>
Expand All @@ -67,7 +53,10 @@ under the License.
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>STRICT</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
<static-connectors>
<connector-ref>server0-connector</connector-ref>
<connector-ref>server2-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:61618</connector>
<connector name="server0-connector">tcp://localhost:61616</connector>
<connector name="server1-connector">tcp://localhost:61617</connector>
</connectors>

<!-- Acceptors -->
Expand All @@ -40,22 +42,6 @@ under the License.
</acceptors>

<!-- Clustering configuration -->
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
<connector-ref>netty-connector</connector-ref>
</broadcast-group>
</broadcast-groups>

<discovery-groups>
<discovery-group name="my-discovery-group">
<group-address>${udp-address:231.7.7.7}</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>

<cluster-user>my-cluster-user</cluster-user>
<cluster-password>my-cluster-password</cluster-password>
Expand All @@ -67,7 +53,10 @@ under the License.
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>STRICT</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
<static-connectors>
<connector-ref>server0-connector</connector-ref>
<connector-ref>server1-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>

Expand Down
4 changes: 2 additions & 2 deletions examples/features/clustered/clustered-jgroups/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ under the License.
<instance>${basedir}/target/server0</instance>
<configuration>${basedir}/target/classes/activemq/server0</configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<javaOptions>-Djava.net.preferIPv4Stack=true -Dartemis.discovery.enabled=true</javaOptions>
</configuration>
</execution>
<execution>
Expand All @@ -72,7 +72,7 @@ under the License.
<instance>${basedir}/target/server1</instance>
<configuration>${basedir}/target/classes/activemq/server1</configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<javaOptions>-Djava.net.preferIPv4Stack=true -Dartemis.discovery.enabled=true</javaOptions>
</configuration>
</execution>
<execution>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
bind_port="${jgroups.bind_port:7800}"
external_addr="${jgroups.external_addr}"
external_port="${jgroups.external_port}"
tls.enabled="true"
tls.client_auth="NEED"
tls.keystore_path="${data.dir}/../etc/server-keystore.jks"
tls.keystore_password="securepass"
tls.keystore_alias="server"
tls.truststore_path="${data.dir}/../etc/server-keystore.jks"
tls.truststore_password="securepass"
thread_pool.min_threads="0"
thread_pool.max_threads="200"
thread_pool.keep_alive_time="30000"/>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
bind_port="${jgroups.bind_port:7800}"
external_addr="${jgroups.external_addr}"
external_port="${jgroups.external_port}"
tls.enabled="true"
tls.client_auth="NEED"
tls.keystore_path="${data.dir}/../etc/server-keystore.jks"
tls.keystore_password="securepass"
tls.keystore_alias="server"
tls.truststore_path="${data.dir}/../etc/server-keystore.jks"
tls.truststore_password="securepass"
thread_pool.min_threads="0"
thread_pool.max_threads="200"
thread_pool.keep_alive_time="30000"/>
Expand Down
Loading
Loading