[ACS-9839] Introduced ACTIVEMQ_URL_PARAMS to avoid the need to override spring.activemq.broker-url directly (#1110)

* [ACS-9839] Introduced ACTIVEMQ_CONN_OPTIONS to avoid the need to override spring.activemq.broker-url directly.

* [ACS-9839] ACTIVEMQ_CONN_OPTIONS -> ACTIVEMQ_URL_PARAMS rename

* [ACS-9839] Restore removed comment
This commit is contained in:
cezary-witkowski
2025-07-21 12:47:56 +02:00
committed by GitHub
parent b62e98a1fd
commit 9cbbbe6068
6 changed files with 20 additions and 12 deletions

View File

@@ -55,8 +55,9 @@ public class MessagingInfo
// For backwards-compatibility, we continue to rely on setting ACTIVEMQ_URL environment variable (see application.yaml) // For backwards-compatibility, we continue to rely on setting ACTIVEMQ_URL environment variable (see application.yaml)
// The MessagingConfig class uses on ConditionalOnProperty (ie. activemq.url is set and not false) // The MessagingConfig class uses on ConditionalOnProperty (ie. activemq.url is set and not false)
// Note: as per application.yaml the broker url is appended with "?jms.watchTopicAdvisories=false". If this needs to be fully // Note: as per application.yaml the broker url is appended with ACTIVEMQ_URL_PARAMS with default value "?jms.watchTopicAdvisories=false".
// overridden then it would require explicitly setting both "spring.activemq.broker-url" *and* "activemq.url" (latter to non-false value). // If this needs to be fully overridden then it would require explicitly setting both "spring.activemq.broker-url"
// *and* "activemq.url" (latter to non-false value). ACTIVEMQ_URL_PARAMS value will be ignored in that case.
if ((activemqUrl != null) && (!activemqUrl.equals("false"))) if ((activemqUrl != null) && (!activemqUrl.equals("false")))
{ {

View File

@@ -5,7 +5,7 @@ spring:
max-file-size: 8192MB max-file-size: 8192MB
max-request-size: 8192MB max-request-size: 8192MB
activemq: activemq:
broker-url: ${ACTIVEMQ_URL:nio://localhost:61616}?jms.watchTopicAdvisories=false broker-url: ${ACTIVEMQ_URL:nio://localhost:61616}${ACTIVEMQ_URL_PARAMS:?jms.watchTopicAdvisories=false}
user: ${ACTIVEMQ_USER:admin} user: ${ACTIVEMQ_USER:admin}
password: ${ACTIVEMQ_PASSWORD:admin} password: ${ACTIVEMQ_PASSWORD:admin}
pool: pool:

View File

@@ -12,6 +12,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 |
| ACTIVEMQ_USER | ActiveMQ User. | admin | | ACTIVEMQ_USER | ActiveMQ User. | admin |
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin | | ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| ACTIVEMQ_URL_PARAMS | ActiveMQ connection options. | ?jms.watchTopicAdvisories=false |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file | | FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| PDFBOX_NOTEXTRACTBOOKMARKS_DEFAULT | The default behaviour for notExtractBookmarksText when this request param is omitted from a request. | false | | PDFBOX_NOTEXTRACTBOOKMARKS_DEFAULT | The default behaviour for notExtractBookmarksText when this request param is omitted from a request. | false |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for receiving async requests. | org.alfresco.transform.engine.tika.acs | | TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for receiving async requests. | org.alfresco.transform.engine.tika.acs |
@@ -25,6 +26,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 |
| ACTIVEMQ_USER | ActiveMQ User. | admin | | ACTIVEMQ_USER | ActiveMQ User. | admin |
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin | | ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| ACTIVEMQ_URL_PARAMS | ActiveMQ connection options. | ?jms.watchTopicAdvisories=false |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file | | FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.alfresco-pdf-renderer.acs | | TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.alfresco-pdf-renderer.acs |
| PDFRENDERER_EXE | Path to Pdf-renderer EXE. | /usr/bin/alfresco-pdf-renderer | | PDFRENDERER_EXE | Path to Pdf-renderer EXE. | /usr/bin/alfresco-pdf-renderer |
@@ -37,6 +39,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 |
| ACTIVEMQ_USER | ActiveMQ User. | admin | | ACTIVEMQ_USER | ActiveMQ User. | admin |
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin | | ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| ACTIVEMQ_URL_PARAMS | ActiveMQ connection options. | ?jms.watchTopicAdvisories=false |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file | | FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.misc.acs | | TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.misc.acs |
| MISC_PDFBOX_DEFAULT_FONT | Default font used by PdfBox | NotoSans-Regular | | MISC_PDFBOX_DEFAULT_FONT | Default font used by PdfBox | NotoSans-Regular |
@@ -50,6 +53,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 |
| ACTIVEMQ_USER | ActiveMQ User. | admin | | ACTIVEMQ_USER | ActiveMQ User. | admin |
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin | | ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| ACTIVEMQ_URL_PARAMS | ActiveMQ connection options. | ?jms.watchTopicAdvisories=false |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file | | FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.libreoffice.acs | | TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.libreoffice.acs |
| LIBREOFFICE_HOME | Path to LibreOffice_Home. | /opt/libreoffice7.2 | | LIBREOFFICE_HOME | Path to LibreOffice_Home. | /opt/libreoffice7.2 |
@@ -67,6 +71,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 |
| ACTIVEMQ_USER | ActiveMQ User. | admin | | ACTIVEMQ_USER | ActiveMQ User. | admin |
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin | | ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| ACTIVEMQ_URL_PARAMS | ActiveMQ connection options. | ?jms.watchTopicAdvisories=false |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file | | FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.imagemagick.acs | | TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.imagemagick.acs |
| IMAGEMAGICK_ROOT | Path to Imagemagick Root. | /usr/lib64/ImageMagick-7.0.10 | | IMAGEMAGICK_ROOT | Path to Imagemagick Root. | /usr/lib64/ImageMagick-7.0.10 |
@@ -83,6 +88,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 |
| ACTIVEMQ_USER | ActiveMQ User. | admin | | ACTIVEMQ_USER | ActiveMQ User. | admin |
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin | | ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| ACTIVEMQ_URL_PARAMS | ActiveMQ connection options. | ?jms.watchTopicAdvisories=false |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file | | FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| PDFBOX_NOTEXTRACTBOOKMARKS_DEFAULT | The default behaviour for notExtractBookmarksText when this request param is omitted from a request. | false | | PDFBOX_NOTEXTRACTBOOKMARKS_DEFAULT | The default behaviour for notExtractBookmarksText when this request param is omitted from a request. | false |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.aio.acs | | TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.aio.acs |

View File

@@ -145,11 +145,11 @@ Vertical scaling can be achieved through Docker, JVM, Spring Boot, or ActiveMQ c
**Default:** 1 set by Spring Autoconfiguration, 1-10 set by base engine's application.yaml **Default:** 1 set by Spring Autoconfiguration, 1-10 set by base engine's application.yaml
- **`SPRING_ACTIVEMQ_BROKERURL` with `jms.prefetchPolicy.all` (Spring Boot/ActiveMQ):** - **`ACTIVEMQ_URL_PARAMS` with `jms.prefetchPolicy.all` (Spring Boot/ActiveMQ):**
Sets the ActiveMQ broker URL. Use this property to configure the broker connection, including prefetch policy settings. Overrides the default ActiveMQ connection options of broker URL by including prefetch policy settings.
It controls how many messages are prefetched from the queue by each consumer before processing. A higher prefetch value can It controls how many messages are prefetched from the queue by each consumer before processing. A higher prefetch value can
improve throughput but may increase memory usage. Note that raising this number might lead to starvation of concurrent consumers! improve throughput but may increase memory usage. Note that raising this number might lead to starvation of concurrent consumers!
**Default:** `tcp://localhost:61616` (prefetch policy default is 1000 for queues) **Default:** `?jms.watchTopicAdvisories=false` (prefetch policy default is 1000 for queues)
**Note:** The T-Engines consumers should be considered as slow consumers. Processing each message can take a significant amount of time. **Note:** The T-Engines consumers should be considered as slow consumers. Processing each message can take a significant amount of time.
So, the prefetch size should be correctly set (based on performance tests) to distribute the messages equally across the nodes So, the prefetch size should be correctly set (based on performance tests) to distribute the messages equally across the nodes
@@ -172,7 +172,7 @@ Below is a single example that combines memory limits, JVM options, concurrency,
ACTIVEMQ_URL: nio://activemq:61616 ACTIVEMQ_URL: nio://activemq:61616
FILE_STORE_URL: >- FILE_STORE_URL: >-
http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file
SPRING_ACTIVEMQ_BROKERURL: "nio://activemq:61616?jms.prefetchPolicy.all=100" # Decreases the message prefetch ACTIVEMQ_URL_PARAMS: ?jms.watchTopicAdvisories=false&jms.prefetchPolicy.all=100 # Decreases the message prefetch
SPRING_ACTIVEMQ_POOL_MAXCONNECTIONS: 100 # Increases the ActiveMQ connection pool SPRING_ACTIVEMQ_POOL_MAXCONNECTIONS: 100 # Increases the ActiveMQ connection pool
JMS_LISTENER_CONCURRENCY: 1-100 # Increases the JMS listener concurrency JMS_LISTENER_CONCURRENCY: 1-100 # Increases the JMS listener concurrency
ports: ports:

View File

@@ -52,8 +52,9 @@ public class MessagingInfo
// For backwards-compatibility, we continue to rely on setting ACTIVEMQ_URL environment variable (see application.yaml) // For backwards-compatibility, we continue to rely on setting ACTIVEMQ_URL environment variable (see application.yaml)
// The MessagingConfig class uses on ConditionalOnProperty (ie. activemq.url is set and not false) // The MessagingConfig class uses on ConditionalOnProperty (ie. activemq.url is set and not false)
// Note: as per application.yaml the broker url is appended with "?jms.watchTopicAdvisories=false". If this needs to be fully // Note: as per application.yaml the broker url is appended with ACTIVEMQ_URL_PARAMS with default value "?jms.watchTopicAdvisories=false".
// overridden then it would require explicitly setting both "spring.activemq.broker-url" *and* "activemq.url" (latter to non-false value). // If this needs to be fully overridden then it would require explicitly setting both "spring.activemq.broker-url"
// *and* "activemq.url" (latter to non-false value). ACTIVEMQ_URL_PARAMS value will be ignored in that case.
if ((activemqUrl != null) && (!activemqUrl.equals("false"))) if ((activemqUrl != null) && (!activemqUrl.equals("false")))
{ {

View File

@@ -5,7 +5,7 @@ spring:
max-file-size: 8192MB max-file-size: 8192MB
max-request-size: 8192MB max-request-size: 8192MB
activemq: activemq:
broker-url: ${ACTIVEMQ_URL:nio://localhost:61616}?jms.watchTopicAdvisories=false broker-url: ${ACTIVEMQ_URL:nio://localhost:61616}${ACTIVEMQ_URL_PARAMS:?jms.watchTopicAdvisories=false}
user: ${ACTIVEMQ_USER:admin} user: ${ACTIVEMQ_USER:admin}
password: ${ACTIVEMQ_PASSWORD:admin} password: ${ACTIVEMQ_PASSWORD:admin}
pool: pool: