This is an automated email from the ASF dual-hosted git repository. robbie pushed a commit to branch development in repository https://gitbox.apache.org/repos/asf/artemis-examples.git
commit 390ac90aaf398646af93e30997e82178564d8236 Author: Robbie Gemmell <[email protected]> AuthorDate: Mon Mar 2 18:14:32 2026 +0000 update core federation downstream examples also switch to disable anonymous login, give a more representative example --- .../federation/federated-address-downstream-upstream/pom.xml | 9 +++++++++ .../src/main/resources/activemq/server0/broker.xml | 2 +- .../src/main/resources/activemq/server1/broker.xml | 4 ++-- .../src/main/resources/activemq/server2/broker.xml | 5 +++-- .../features/federation/federated-address-downstream/pom.xml | 9 +++++++++ .../src/main/resources/activemq/server0/broker.xml | 4 ++-- .../src/main/resources/activemq/server1/broker.xml | 4 ++-- .../src/main/resources/activemq/server2/broker.xml | 4 ++-- .../activemq/artemis/jms/example/FederatedAddressExample.java | 6 +++--- .../federation/federated-queue-downstream-upstream/pom.xml | 11 ++++++++++- .../src/main/resources/activemq/server0/broker.xml | 2 +- .../src/main/resources/activemq/server1/broker.xml | 4 ++-- .../src/main/resources/activemq/server2/broker.xml | 5 +++-- .../features/federation/federated-queue-downstream/pom.xml | 9 +++++++++ .../src/main/resources/activemq/server0/broker.xml | 4 ++-- .../src/main/resources/activemq/server1/broker.xml | 4 ++-- .../src/main/resources/activemq/server2/broker.xml | 4 ++-- .../activemq/artemis/jms/example/FederatedQueueExample.java | 6 +++--- 18 files changed, 67 insertions(+), 29 deletions(-) diff --git a/examples/features/federation/federated-address-downstream-upstream/pom.xml b/examples/features/federation/federated-address-downstream-upstream/pom.xml index f951c2a0..67bb4e77 100644 --- a/examples/features/federation/federated-address-downstream-upstream/pom.xml +++ b/examples/features/federation/federated-address-downstream-upstream/pom.xml @@ -58,6 +58,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server0</instance> <configuration>${basedir}/target/classes/activemq/server0</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -71,6 +72,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server1</instance> <configuration>${basedir}/target/classes/activemq/server1</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -84,6 +86,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server2</instance> <configuration>${basedir}/target/classes/activemq/server2</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -98,6 +101,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server0</location> <testURI>tcp://localhost:61616</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -114,6 +119,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server1</location> <testURI>tcp://localhost:61617</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -130,6 +137,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server2</location> <testURI>tcp://localhost:61618</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> diff --git a/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server0/broker.xml b/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server0/broker.xml index e3eb6df0..d99806bf 100644 --- a/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. <!-- Federation --> <federations> - <federation name="eu-west-1-federation"> + <federation name="eu-west-1-federation" user="guest" password="guest"> <upstream name="eu-east-1-upstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <share-connection>true</share-connection> diff --git a/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server1/broker.xml b/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server1/broker.xml index 626cd958..6a63a115 100644 --- a/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server1/broker.xml +++ b/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server1/broker.xml @@ -44,8 +44,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="eu-east-1-federation"> + <federations downstream-authorization="guest"> + <federation name="eu-east-1-federation" user="guest" password="guest"> <upstream name="us-central-1-upstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <share-connection>true</share-connection> diff --git a/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server2/broker.xml b/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server2/broker.xml index 8cb6973f..2cb7742d 100644 --- a/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server2/broker.xml +++ b/examples/features/federation/federated-address-downstream-upstream/src/main/resources/activemq/server2/broker.xml @@ -42,8 +42,9 @@ under the License. <!-- Federation --> - <!--No federation configuration necessary as the other brokers will be creating downstreams/upstreams - to this broker--> + <federations downstream-authorization="guest"> + <!-- Only downstream-authorization role config necessary, the other brokers will be creating downstreams/upstreams to this broker--> + </federations> <!-- Other config --> diff --git a/examples/features/federation/federated-address-downstream/pom.xml b/examples/features/federation/federated-address-downstream/pom.xml index 079b607c..b24c2ca1 100644 --- a/examples/features/federation/federated-address-downstream/pom.xml +++ b/examples/features/federation/federated-address-downstream/pom.xml @@ -58,6 +58,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server0</instance> <configuration>${basedir}/target/classes/activemq/server0</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -71,6 +72,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server1</instance> <configuration>${basedir}/target/classes/activemq/server1</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -84,6 +86,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server2</instance> <configuration>${basedir}/target/classes/activemq/server2</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -98,6 +101,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server0</location> <testURI>tcp://localhost:61616</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -114,6 +119,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server1</location> <testURI>tcp://localhost:61617</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -130,6 +137,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server2</location> <testURI>tcp://localhost:61618</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> diff --git a/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server0/broker.xml b/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server0/broker.xml index 73c774c3..f1ed7715 100644 --- a/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server0/broker.xml @@ -45,8 +45,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="eu-west-1-federation"> + <federations downstream-authorization="guest"> + <federation name="eu-west-1-federation" user="guest" password="guest"> <downstream name="eu-east-1-downstream" > <circuit-breaker-timeout>1000</circuit-breaker-timeout> <static-connectors> diff --git a/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server1/broker.xml b/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server1/broker.xml index 0bc2579f..19908600 100644 --- a/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server1/broker.xml +++ b/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server1/broker.xml @@ -45,8 +45,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="eu-east-1-federation"> + <federations downstream-authorization="guest"> + <federation name="eu-east-1-federation" user="guest" password="guest"> <downstream name="eu-west-1-downstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <static-connectors> diff --git a/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server2/broker.xml b/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server2/broker.xml index a80ea60b..3186ca17 100644 --- a/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server2/broker.xml +++ b/examples/features/federation/federated-address-downstream/src/main/resources/activemq/server2/broker.xml @@ -46,8 +46,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="us-central-1-federation"> + <federations downstream-authorization="guest"> + <federation name="us-central-1-federation" user="guest" password="guest"> <downstream name="eu-east-1-downstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <static-connectors> diff --git a/examples/features/federation/federated-address/src/main/java/org/apache/activemq/artemis/jms/example/FederatedAddressExample.java b/examples/features/federation/federated-address/src/main/java/org/apache/activemq/artemis/jms/example/FederatedAddressExample.java index c5febc3b..06de962d 100644 --- a/examples/features/federation/federated-address/src/main/java/org/apache/activemq/artemis/jms/example/FederatedAddressExample.java +++ b/examples/features/federation/federated-address/src/main/java/org/apache/activemq/artemis/jms/example/FederatedAddressExample.java @@ -55,13 +55,13 @@ public class FederatedAddressExample { // Step 5. We create a JMS Connection connectionEUWest which is a connection to server EU West - connectionEUWest = cfEUWest.createConnection(); + connectionEUWest = cfEUWest.createConnection("guest", "guest"); // Step 6. We create a JMS Connection connectionEUEast which is a connection to server EU East - connectionEUEast = cfEUEast.createConnection(); + connectionEUEast = cfEUEast.createConnection("guest", "guest"); // Step 7. We create a JMS Connection connectionUSCentral which is a connection to server US Central - connectionUSCentral = cfUSCentral.createConnection(); + connectionUSCentral = cfUSCentral.createConnection("guest", "guest"); // Step 8. We create a JMS Session on server EU West Session sessionEUWest = connectionEUWest.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/examples/features/federation/federated-queue-downstream-upstream/pom.xml b/examples/features/federation/federated-queue-downstream-upstream/pom.xml index 747b7fb6..683f9f8f 100644 --- a/examples/features/federation/federated-queue-downstream-upstream/pom.xml +++ b/examples/features/federation/federated-queue-downstream-upstream/pom.xml @@ -58,6 +58,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server0</instance> <configuration>${basedir}/target/classes/activemq/server0</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -71,6 +72,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server1</instance> <configuration>${basedir}/target/classes/activemq/server1</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -84,6 +86,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server2</instance> <configuration>${basedir}/target/classes/activemq/server2</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -98,6 +101,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server0</location> <testURI>tcp://localhost:61616</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -114,6 +119,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server1</location> <testURI>tcp://localhost:61617</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -130,6 +137,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server2</location> <testURI>tcp://localhost:61618</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -190,4 +199,4 @@ under the License. </plugin> </plugins> </build> -</project> \ No newline at end of file +</project> diff --git a/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server0/broker.xml b/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server0/broker.xml index 5c06f622..fd7648f6 100644 --- a/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. <!-- Federation --> <federations> - <federation name="eu-west-1-federation"> + <federation name="eu-west-1-federation" user="guest" password="guest"> <upstream name="eu-east-1-upstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <share-connection>true</share-connection> diff --git a/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server1/broker.xml b/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server1/broker.xml index 1e9a4977..7e084fae 100644 --- a/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server1/broker.xml +++ b/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server1/broker.xml @@ -44,8 +44,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="eu-east-1-federation"> + <federations downstream-authorization="guest"> + <federation name="eu-east-1-federation" user="guest" password="guest"> <upstream name="us-central-1-upstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <share-connection>true</share-connection> diff --git a/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server2/broker.xml b/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server2/broker.xml index f674e9f3..98f9ae0d 100644 --- a/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server2/broker.xml +++ b/examples/features/federation/federated-queue-downstream-upstream/src/main/resources/activemq/server2/broker.xml @@ -45,8 +45,9 @@ under the License. <!-- Federation --> - <!--No federation configuration necessary as the other brokers will be creating downstreams/upstreams - to this broker--> + <federations downstream-authorization="guest"> + <!-- Only downstream-authorization role config necessary, the other brokers will be creating downstreams/upstreams to this broker--> + </federations> <!-- Other config --> diff --git a/examples/features/federation/federated-queue-downstream/pom.xml b/examples/features/federation/federated-queue-downstream/pom.xml index dd0033ac..dfdb0265 100644 --- a/examples/features/federation/federated-queue-downstream/pom.xml +++ b/examples/features/federation/federated-queue-downstream/pom.xml @@ -58,6 +58,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server0</instance> <configuration>${basedir}/target/classes/activemq/server0</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -71,6 +72,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server1</instance> <configuration>${basedir}/target/classes/activemq/server1</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -84,6 +86,7 @@ under the License. <ignore>${noServer}</ignore> <instance>${basedir}/target/server2</instance> <configuration>${basedir}/target/classes/activemq/server2</configuration> + <allowAnonymous>false</allowAnonymous> <!-- this makes it easier in certain envs --> <javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions> </configuration> @@ -98,6 +101,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server0</location> <testURI>tcp://localhost:61616</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -114,6 +119,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server1</location> <testURI>tcp://localhost:61617</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> @@ -130,6 +137,8 @@ under the License. <spawn>true</spawn> <location>${basedir}/target/server2</location> <testURI>tcp://localhost:61618</testURI> + <testUser>guest</testUser> + <testPassword>guest</testPassword> <args> <param>run</param> </args> diff --git a/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server0/broker.xml b/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server0/broker.xml index 4cb986a9..ee20349c 100644 --- a/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server0/broker.xml @@ -45,8 +45,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="eu-west-1-federation"> + <federations downstream-authorization="guest"> + <federation name="eu-west-1-federation" user="guest" password="guest"> <downstream name="eu-east-1-downstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <static-connectors> diff --git a/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server1/broker.xml b/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server1/broker.xml index fd862ccf..7a674fc7 100644 --- a/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server1/broker.xml +++ b/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server1/broker.xml @@ -45,8 +45,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="eu-east-1-federation"> + <federations downstream-authorization="guest"> + <federation name="eu-east-1-federation" user="guest" password="guest"> <downstream name="eu-west-1-downstream"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <static-connectors> diff --git a/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server2/broker.xml b/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server2/broker.xml index be8a8f13..a3fa2839 100644 --- a/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server2/broker.xml +++ b/examples/features/federation/federated-queue-downstream/src/main/resources/activemq/server2/broker.xml @@ -46,8 +46,8 @@ under the License. <!-- Federation --> - <federations> - <federation name="us-central-1-federation"> + <federations downstream-authorization="guest"> + <federation name="us-central-1-federation" user="guest" password="guest"> <downstream name="eu-east-1-downstream" priority-adjustment="-1"> <circuit-breaker-timeout>1000</circuit-breaker-timeout> <static-connectors> diff --git a/examples/features/federation/federated-queue/src/main/java/org/apache/activemq/artemis/jms/example/FederatedQueueExample.java b/examples/features/federation/federated-queue/src/main/java/org/apache/activemq/artemis/jms/example/FederatedQueueExample.java index e594b961..2d8189a5 100644 --- a/examples/features/federation/federated-queue/src/main/java/org/apache/activemq/artemis/jms/example/FederatedQueueExample.java +++ b/examples/features/federation/federated-queue/src/main/java/org/apache/activemq/artemis/jms/example/FederatedQueueExample.java @@ -57,13 +57,13 @@ public class FederatedQueueExample { // Step 5. We create a JMS Connection connectionEUWest which is a connection to server EU West - connectionEUWest = cfEUWest.createConnection(); + connectionEUWest = cfEUWest.createConnection("guest", "guest"); // Step 6. We create a JMS Connection connectionEUEast which is a connection to server EU East - connectionEUEast = cfEUEast.createConnection(); + connectionEUEast = cfEUEast.createConnection("guest", "guest"); // Step 7. We create a JMS Connection connectionUSCentral which is a connection to server US Central - connectionUSCentral = cfUSCentral.createConnection(); + connectionUSCentral = cfUSCentral.createConnection("guest", "guest"); // Step 8. We create a JMS Session on server EU West Session sessionEUWest = connectionEUWest.createSession(false, Session.AUTO_ACKNOWLEDGE); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
