From b897786a7cf8da0741142c2a89a65e252728167b Mon Sep 17 00:00:00 2001 From: Kacper Magdziarz <95610011+kmagdziarz@users.noreply.github.com> Date: Mon, 2 Feb 2026 12:07:54 +0100 Subject: [PATCH] [ACS-10783] && [ACS-10784] Upgrade ActiveMQ Server to 6.2.0 and create backward compatibility tests with ActiveMQ 5.X server (#3752) --- .github/workflows/ci.yml | 14 +++++++---- .secrets.baseline | 10 ++++---- amps/ags/rm-community/rm-community-repo/.env | 2 +- .../rm-community-repo/docker-compose.yml | 2 ++ .../rm-community/rm-community-repo/pom.xml | 4 +-- packaging/tests/environment/.env | 2 +- .../docker-compose-minimal+transforms.yml | 2 ++ .../environment/docker-compose-minimal.yml | 4 ++- pom.xml | 2 +- .../test/resources/alfresco-global.properties | 2 +- repository/pom.xml | 2 +- .../Messaging/default/messaging-context.xml | 2 +- .../event2/AbstractContextAwareRepoEvent.java | 12 ++++++--- .../repo/event2/EventGeneratorTest.java | 16 ++++++++---- .../test/resources/test-messaging.properties | 4 +-- .../ci/docker-compose/docker-compose-db.yaml | 4 +-- scripts/ci/docker-compose/docker-compose.yaml | 25 +++++++++++++------ 17 files changed, 69 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a16d239ad2..66541c4cf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,7 +251,7 @@ jobs: timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d - name: "Run tests" - run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco # pragma: allowlist secret + run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dmessaging.broker.username=admin -Dmessaging.broker.password=admin # pragma: allowlist secret - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -431,13 +431,17 @@ jobs: run: bash ./scripts/ci/cleanup_cache.sh repository_messaging_tests: - name: Repository - Messaging tests + name: Repository - Messaging tests against ${{ matrix.activemq }} runs-on: ubuntu-latest needs: [prepare] if: > !contains(github.event.head_commit.message, '[skip repo]') && !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + activemq: [ 'activemq6', 'activemq5' ] steps: - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3 @@ -448,9 +452,9 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run ActiveMQ" - run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.activemq }} up -d - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false # pragma: allowlist secret + run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false -Dmessaging.broker.username=admin -Dmessaging.broker.password=admin # pragma: allowlist secret - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh @@ -524,7 +528,7 @@ jobs: timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.mvn-options }} # pragma: allowlist secret + run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dmessaging.broker.username=admin -Dmessaging.broker.password=admin ${{ matrix.mvn-options }} # pragma: allowlist secret - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh diff --git a/.secrets.baseline b/.secrets.baseline index 68e593b2fb..5cebf5c984 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -358,7 +358,7 @@ "filename": "packaging/tests/environment/docker-compose-minimal+transforms.yml", "hashed_secret": "d1ebbc78705ad98aa2c8fb357d2e30c8f001673a", "is_verified": false, - "line_number": 76 + "line_number": 78 } ], "packaging/tests/environment/docker-compose-minimal.yml": [ @@ -381,7 +381,7 @@ "filename": "packaging/tests/environment/docker-compose-minimal.yml", "hashed_secret": "d1ebbc78705ad98aa2c8fb357d2e30c8f001673a", "is_verified": false, - "line_number": 79 + "line_number": 81 } ], "packaging/tests/scripts/wait-for-alfresco-start.sh": [ @@ -1832,7 +1832,7 @@ "filename": "scripts/ci/docker-compose/docker-compose.yaml", "hashed_secret": "d033e22ae348aeb5660fc2140aec35850c4da997", "is_verified": false, - "line_number": 39, + "line_number": 48, "is_secret": false }, { @@ -1840,10 +1840,10 @@ "filename": "scripts/ci/docker-compose/docker-compose.yaml", "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "is_verified": false, - "line_number": 43, + "line_number": 52, "is_secret": false } ] }, - "generated_at": "2025-12-30T10:31:21Z" + "generated_at": "2026-01-30T13:46:48Z" } diff --git a/amps/ags/rm-community/rm-community-repo/.env b/amps/ags/rm-community/rm-community-repo/.env index 79fa4dc171..a25421fe2e 100644 --- a/amps/ags/rm-community/rm-community-repo/.env +++ b/amps/ags/rm-community/rm-community-repo/.env @@ -1,3 +1,3 @@ SOLR6_TAG=2.0.16 POSTGRES_TAG=16.6 -ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8 +ACTIVEMQ_TAG=6.2.0-jre17-rockylinux8 diff --git a/amps/ags/rm-community/rm-community-repo/docker-compose.yml b/amps/ags/rm-community/rm-community-repo/docker-compose.yml index 1d128c8634..be76fbe5f3 100644 --- a/amps/ags/rm-community/rm-community-repo/docker-compose.yml +++ b/amps/ags/rm-community/rm-community-repo/docker-compose.yml @@ -92,5 +92,7 @@ services: image: alfresco/alfresco-transform-core-aio:${TRANSFORMERS_TAG} environment: JAVA_OPTS: " -Xms256m -Xmx512m" + SPRING_ACTIVEMQ_USER: admin + SPRING_ACTIVEMQ_PASSWORD: admin #pragma: allowlist secret ports: - 8090:8090 diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index f74b51c524..25f4608394 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -442,7 +442,7 @@ - alfresco/alfresco-activemq:5.18.3-jre17-rockylinux8 + alfresco/alfresco-activemq:6.2-jre17-rockylinux8 ${activemq.port1}:${activemq.port1} @@ -513,7 +513,7 @@ - alfresco/alfresco-activemq:5.18.3-jre17-rockylinux8 + alfresco/alfresco-activemq:6.2-jre17-rockylinux8 ${activemq.port1}:${activemq.port1} diff --git a/packaging/tests/environment/.env b/packaging/tests/environment/.env index 79fa4dc171..a25421fe2e 100644 --- a/packaging/tests/environment/.env +++ b/packaging/tests/environment/.env @@ -1,3 +1,3 @@ SOLR6_TAG=2.0.16 POSTGRES_TAG=16.6 -ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8 +ACTIVEMQ_TAG=6.2.0-jre17-rockylinux8 diff --git a/packaging/tests/environment/docker-compose-minimal+transforms.yml b/packaging/tests/environment/docker-compose-minimal+transforms.yml index 1371162217..cb1119362c 100644 --- a/packaging/tests/environment/docker-compose-minimal+transforms.yml +++ b/packaging/tests/environment/docker-compose-minimal+transforms.yml @@ -40,6 +40,8 @@ services: -Dshare.host=localhost -Daos.baseUrlOverwrite=http://localhost:8082/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" + -Dmessaging.broker.username=admin + -Dmessaging.broker.password=admin -DlocalTransform.core-aio.url=http://transform-core-aio:8090/ -Dimap.server.port=1143 -Dftp.port=1221 diff --git a/packaging/tests/environment/docker-compose-minimal.yml b/packaging/tests/environment/docker-compose-minimal.yml index 81eec6b7e6..fb7c7f6cfb 100644 --- a/packaging/tests/environment/docker-compose-minimal.yml +++ b/packaging/tests/environment/docker-compose-minimal.yml @@ -40,6 +40,8 @@ services: -Dshare.host=localhost -Daos.baseUrlOverwrite=http://localhost:8082/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" + -Dmessaging.broker.username=admin + -Dmessaging.broker.password=admin -Dlocal.transform.service.enabled=false -Dlegacy.transform.service.enabled=false -Dimap.server.port=1143 @@ -89,4 +91,4 @@ services: - 8161:8161 # Web Console - 5672:5672 # AMQP - 61616:61616 # OpenWire - - 61613:61613 # STOMP \ No newline at end of file + - 61613:61613 # STOMP diff --git a/pom.xml b/pom.xml index 5b68060f06..79c3cc892a 100644 --- a/pom.xml +++ b/pom.xml @@ -817,7 +817,7 @@ org.apache.camel - camel-activemq + camel-activemq6 ${dependency.camel.version} diff --git a/remote-api/src/test/resources/alfresco-global.properties b/remote-api/src/test/resources/alfresco-global.properties index 654011a248..c8099e8052 100644 --- a/remote-api/src/test/resources/alfresco-global.properties +++ b/remote-api/src/test/resources/alfresco-global.properties @@ -1,4 +1,4 @@ opencmis.tck.readtimeout=10000 opencmis.tck.connecttimeout=10000 -system.workflow.engine.activiti.taskvariableslimit=200 \ No newline at end of file +system.workflow.engine.activiti.taskvariableslimit=200 diff --git a/repository/pom.xml b/repository/pom.xml index bd4dcf22ef..4f9d25384b 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -564,7 +564,7 @@ org.apache.camel - camel-activemq + camel-activemq6 org.apache.camel diff --git a/repository/src/main/resources/alfresco/subsystems/Messaging/default/messaging-context.xml b/repository/src/main/resources/alfresco/subsystems/Messaging/default/messaging-context.xml index 6ccc7bc8ef..15d0110a9f 100644 --- a/repository/src/main/resources/alfresco/subsystems/Messaging/default/messaging-context.xml +++ b/repository/src/main/resources/alfresco/subsystems/Messaging/default/messaging-context.xml @@ -39,7 +39,7 @@ - + diff --git a/repository/src/test/java/org/alfresco/repo/event2/AbstractContextAwareRepoEvent.java b/repository/src/test/java/org/alfresco/repo/event2/AbstractContextAwareRepoEvent.java index f90ae60523..0bca6cad1f 100644 --- a/repository/src/test/java/org/alfresco/repo/event2/AbstractContextAwareRepoEvent.java +++ b/repository/src/test/java/org/alfresco/repo/event2/AbstractContextAwareRepoEvent.java @@ -2,7 +2,7 @@ * #%L * Alfresco Repository * %% - * Copyright (C) 2005 - 2025 Alfresco Software Limited + * Copyright (C) 2005 - 2026 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of @@ -51,6 +51,7 @@ import org.junit.Before; import org.junit.BeforeClass; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; import org.springframework.test.context.TestPropertySource; import org.alfresco.model.ContentModel; @@ -96,6 +97,11 @@ public abstract class AbstractContextAwareRepoEvent extends BaseSpringTest protected final Locale frenchLocale = new Locale(Locale.FRENCH.getLanguage()); protected final Locale japaneseLocale = new Locale(Locale.JAPANESE.getLanguage(), "YY", "ZZ"); + @Value("${messaging.broker.password}") + private String acqPassword; + @Value("${messaging.broker.username}") + private String acqUsername; + private static boolean isCamelConfigured; private static DataFormat dataFormat; @@ -180,7 +186,7 @@ public abstract class AbstractContextAwareRepoEvent extends BaseSpringTest int count = maxloops; do { - Thread.sleep(165l); + Thread.sleep(165L); if (EVENT_CONTAINER.isEmpty()) { count--; @@ -436,7 +442,7 @@ public abstract class AbstractContextAwareRepoEvent extends BaseSpringTest private void configRoute() throws Exception { - final ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_URL); + final ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(acqUsername, acqPassword, BROKER_URL); CAMEL_CONTEXT.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); CAMEL_CONTEXT.addRoutes(new RouteBuilder() { diff --git a/repository/src/test/java/org/alfresco/repo/event2/EventGeneratorTest.java b/repository/src/test/java/org/alfresco/repo/event2/EventGeneratorTest.java index 6a2123e320..3e52692553 100644 --- a/repository/src/test/java/org/alfresco/repo/event2/EventGeneratorTest.java +++ b/repository/src/test/java/org/alfresco/repo/event2/EventGeneratorTest.java @@ -2,7 +2,7 @@ * #%L * Alfresco Repository * %% - * Copyright (C) 2005 - 2025 Alfresco Software Limited + * Copyright (C) 2005 - 2026 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of @@ -47,6 +47,7 @@ import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Value; import org.alfresco.model.ContentModel; import org.alfresco.repo.event.v1.model.RepoEvent; @@ -57,14 +58,19 @@ public abstract class EventGeneratorTest extends AbstractContextAwareRepoEvent private static final String EVENT2_TOPIC_NAME = "alfresco.repo.event2"; private static final long DUMP_BROKER_TIMEOUT = 50000000L; + @Value("${messaging.broker.password}") + private String acqPassword; + @Value("${messaging.broker.username}") + private String acqUsername; + private ActiveMQConnection connection; protected List> receivedEvents; @Before public void startupTopicListener() throws Exception { - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); - connection = (ActiveMQConnection) connectionFactory.createConnection(); + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(acqUsername, acqPassword, "tcp://localhost:61616"); + connection = (ActiveMQConnection) connectionFactory.createConnection(acqUsername, acqPassword); connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -180,8 +186,8 @@ public abstract class EventGeneratorTest extends AbstractContextAwareRepoEvent { System.out.println("Broker at url: '" + url + "'"); - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url); - ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection(); + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "admin", url); + ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection("admin", "admin"); try { connection.start(); diff --git a/repository/src/test/resources/test-messaging.properties b/repository/src/test/resources/test-messaging.properties index fee0fe7fcf..02cd289a79 100644 --- a/repository/src/test/resources/test-messaging.properties +++ b/repository/src/test/resources/test-messaging.properties @@ -2,8 +2,6 @@ messaging.broker.url=nio://localhost:61616 messaging.broker.ssl=false messaging.broker.connections.max=8 messaging.transacted=true -messaging.broker.username= -messaging.broker.password= acs.repo.rendition.events.endpoint=jms:acs-repo-rendition-events-test?jmsMessageType=Text -acs.repo.transform.request.endpoint=jms:acs-repo-transform-request-test?jmsMessageType=Text \ No newline at end of file +acs.repo.transform.request.endpoint=jms:acs-repo-transform-request-test?jmsMessageType=Text diff --git a/scripts/ci/docker-compose/docker-compose-db.yaml b/scripts/ci/docker-compose/docker-compose-db.yaml index acdeba1858..4b50c582fe 100644 --- a/scripts/ci/docker-compose/docker-compose-db.yaml +++ b/scripts/ci/docker-compose/docker-compose-db.yaml @@ -34,7 +34,7 @@ services: ports: - "3307:3306" activemq: - image: alfresco/alfresco-activemq:5.18.3-jre17-rockylinux8 + image: alfresco/alfresco-activemq:6.2-jre17-rockylinux8 ports: - "5672:5672" # AMQP - - "61616:61616" # OpenWire \ No newline at end of file + - "61616:61616" # OpenWire diff --git a/scripts/ci/docker-compose/docker-compose.yaml b/scripts/ci/docker-compose/docker-compose.yaml index 627424f841..6c054efd3a 100644 --- a/scripts/ci/docker-compose/docker-compose.yaml +++ b/scripts/ci/docker-compose/docker-compose.yaml @@ -12,15 +12,24 @@ services: image: postgres:16.6 profiles: ["default", "with-transform-core-aio", "postgres", "with-mtls-transform-core-aio", "with-sso"] environment: - - POSTGRES_PASSWORD=alfresco - - POSTGRES_USER=alfresco - - POSTGRES_DB=alfresco + POSTGRES_PASSWORD: alfresco #pragma: allowlist secret + POSTGRES_USER: alfresco + POSTGRES_DB: alfresco command: postgres -c max_connections=300 ports: - "5433:5432" activemq: - profiles: ["default", "with-transform-core-aio", "activemq", "with-mtls-transform-core-aio", "with-sso"] - image: alfresco/alfresco-activemq:5.18.3-jre17-rockylinux8 + profiles: ["default", "with-transform-core-aio", "activemq", "activemq6", "with-mtls-transform-core-aio", "with-sso"] + image: alfresco/alfresco-activemq:6.2-jre17-rockylinux8 + environment: + ACTIVEMQ_ADMIN_LOGIN: admin + ACTIVEMQ_ADMIN_PASSWORD: admin #pragma: allowlist secret + ports: + - "5672:5672" # AMQP + - "61616:61616" # OpenWire + activemq5: + profiles: ["activemq5"] + image: alfresco/alfresco-activemq:5.19-jre17-rockylinux8 ports: - "5672:5672" # AMQP - "61616:61616" # OpenWire @@ -61,9 +70,9 @@ services: profiles: ["with-sso"] image: quay.io/keycloak/keycloak:26.5.0 environment: - - KC_BOOTSTRAP_ADMIN_USERNAME=admin - - KC_BOOTSTRAP_ADMIN_PASSWORD=admin - - KC_DB=dev-file + KC_BOOTSTRAP_ADMIN_USERNAME: admin + KC_BOOTSTRAP_ADMIN_PASSWORD: admin #pragma: allowlist secret + KC_DB: dev-file command: ["start-dev", "--import-realm", "--http-relative-path=/auth", "--hostname=localhost", "--http-enabled=true"] volumes: - ../../../repository/src/test/resources/realms/alfresco-realm.json:/opt/keycloak/data/import/alfresco-realm.json