diff --git a/deprecated/alfresco-transformer-base/src/main/java/org/alfresco/transformer/messaging/MessagingInfo.java b/deprecated/alfresco-transformer-base/src/main/java/org/alfresco/transformer/messaging/MessagingInfo.java index 37f638f4..c625589d 100644 --- a/deprecated/alfresco-transformer-base/src/main/java/org/alfresco/transformer/messaging/MessagingInfo.java +++ b/deprecated/alfresco-transformer-base/src/main/java/org/alfresco/transformer/messaging/MessagingInfo.java @@ -55,8 +55,9 @@ public class MessagingInfo // 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) - // Note: as per application.yaml the broker url is appended with "?jms.watchTopicAdvisories=false". 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). + // Note: as per application.yaml the broker url is appended with ACTIVEMQ_URL_PARAMS with default value "?jms.watchTopicAdvisories=false". + // 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"))) { diff --git a/deprecated/alfresco-transformer-base/src/main/resources/application.yaml b/deprecated/alfresco-transformer-base/src/main/resources/application.yaml index a1b1a17e..0fbc18f4 100644 --- a/deprecated/alfresco-transformer-base/src/main/resources/application.yaml +++ b/deprecated/alfresco-transformer-base/src/main/resources/application.yaml @@ -5,7 +5,7 @@ spring: max-file-size: 8192MB max-request-size: 8192MB 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} password: ${ACTIVEMQ_PASSWORD:admin} pool: diff --git a/docs/external-engine-configuration.md b/docs/external-engine-configuration.md index 4521dd45..3023ce09 100644 --- a/docs/external-engine-configuration.md +++ b/docs/external-engine-configuration.md @@ -12,6 +12,7 @@ The following externalized T-engines properties are available: | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_USER | ActiveMQ User. | 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 | | 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 | @@ -25,6 +26,7 @@ The following externalized T-engines properties are available: | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_USER | ActiveMQ User. | 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 | | 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 | @@ -37,6 +39,7 @@ The following externalized T-engines properties are available: | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_USER | ActiveMQ User. | 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 | | 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 | @@ -50,6 +53,7 @@ The following externalized T-engines properties are available: | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_USER | ActiveMQ User. | 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 | | 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 | @@ -67,6 +71,7 @@ The following externalized T-engines properties are available: | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_USER | ActiveMQ User. | 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 | | 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 | @@ -83,6 +88,7 @@ The following externalized T-engines properties are available: | ACTIVEMQ_URL | ActiveMQ URL. | nio://localhost:61616 | | ACTIVEMQ_USER | ActiveMQ User. | 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 | | 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 | @@ -100,4 +106,4 @@ The following externalized T-engines properties are available: | IMAGEMAGICK_CODERS | Path to Imagemagick custom coders. | | | IMAGEMAGICK_CONFIG | Path to Imagemagick custom config. | | | MISC_PDFBOX_DEFAULT_FONT | Default font used by PdfBox | NotoSans-Regular | -| MISC_HTML_COLLAPSE | Html Collasping Option for HTML to TXT transformation explicitly for Misc Engine | true | \ No newline at end of file +| MISC_HTML_COLLAPSE | Html Collasping Option for HTML to TXT transformation explicitly for Misc Engine | true | diff --git a/docs/t-engine-scaling.md b/docs/t-engine-scaling.md index 5a736a9a..58ce2b87 100644 --- a/docs/t-engine-scaling.md +++ b/docs/t-engine-scaling.md @@ -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 -- **`SPRING_ACTIVEMQ_BROKERURL` with `jms.prefetchPolicy.all` (Spring Boot/ActiveMQ):** - Sets the ActiveMQ broker URL. Use this property to configure the broker connection, including prefetch policy settings. +- **`ACTIVEMQ_URL_PARAMS` with `jms.prefetchPolicy.all` (Spring Boot/ActiveMQ):** + 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 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. 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 FILE_STORE_URL: >- 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 JMS_LISTENER_CONCURRENCY: 1-100 # Increases the JMS listener concurrency ports: @@ -189,4 +189,4 @@ Below is a single example that combines memory limits, JVM options, concurrency, - **`JAVA_OPTS` (JVM):** JVM maximum RAM percentage to 100% of `mem_limit` is not recommended, as this can cause the JVM to use all available container memory, leaving no room for other processes and potentially leading to container restarts due to out-of-memory (OOM) - errors. \ No newline at end of file + errors. diff --git a/engines/base/src/main/java/org/alfresco/transform/base/messaging/MessagingInfo.java b/engines/base/src/main/java/org/alfresco/transform/base/messaging/MessagingInfo.java index 8695234b..f445aeef 100644 --- a/engines/base/src/main/java/org/alfresco/transform/base/messaging/MessagingInfo.java +++ b/engines/base/src/main/java/org/alfresco/transform/base/messaging/MessagingInfo.java @@ -52,8 +52,9 @@ public class MessagingInfo // 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) - // Note: as per application.yaml the broker url is appended with "?jms.watchTopicAdvisories=false". 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). + // Note: as per application.yaml the broker url is appended with ACTIVEMQ_URL_PARAMS with default value "?jms.watchTopicAdvisories=false". + // 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"))) { diff --git a/engines/base/src/main/resources/application.yaml b/engines/base/src/main/resources/application.yaml index 72d20fb3..d08eb436 100644 --- a/engines/base/src/main/resources/application.yaml +++ b/engines/base/src/main/resources/application.yaml @@ -5,7 +5,7 @@ spring: max-file-size: 8192MB max-request-size: 8192MB 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} password: ${ACTIVEMQ_PASSWORD:admin} pool: