From 0c5f0efceaf7d36739ad813f3767aecac020809b Mon Sep 17 00:00:00 2001 From: Moritz Kammerer Date: Sat, 2 Oct 2021 10:37:08 +0200 Subject: [PATCH 1/2] Explain how to disable/configure the ActiveMQ embedded broker See gh-28183 --- .../src/docs/asciidoc/spring-boot-features.adoc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 7944a92229b5..320d10529da2 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -5840,12 +5840,25 @@ Spring Boot also auto-configures the necessary infrastructure to send and receiv [[boot-features-activemq]] ==== ActiveMQ Support When https://activemq.apache.org/[ActiveMQ] is available on the classpath, Spring Boot can also configure a `ConnectionFactory`. -If the broker is present, an embedded broker is automatically started and configured (provided no broker URL is specified through configuration). +If the broker is present, an embedded broker is automatically started and configured (provided no broker URL is specified through configuration and the embedded broker is not disabled in the configuration). NOTE: If you use `spring-boot-starter-activemq`, the necessary dependencies to connect or embed an ActiveMQ instance are provided, as is the Spring infrastructure to integrate with JMS. ActiveMQ configuration is controlled by external configuration properties in `+spring.activemq.*+`. -For example, you might declare the following section in `application.properties`: + +By default an embedded broker is started, if you don't disable it explicitly and don't set the broker url. The broker +url is then autoconfigured to use the https://activemq.apache.org/vm-transport-reference.html[VM transport], which starts +an ActiveMQ broker in the same JVM instance. + +You can disable the embedded broker by declaring the following section in `application.properties`: +[source,yaml,indent=0,subs="verbatim",configprops,configblocks] +---- + spring: + activemq: + in-memory: false +---- + +or by setting the broker url explicitly: [source,yaml,indent=0,configprops,configblocks] ---- From 8a78864eddb23c29451352a32daf6034071bd8ee Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 22 Oct 2021 12:22:20 +0100 Subject: [PATCH 2/2] Polish "Explain how to disable/configure the ActiveMQ embedded broker" See gh-28183 --- .../src/docs/asciidoc/spring-boot-features.adoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 320d10529da2..2e3b5ae222b7 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -5846,11 +5846,10 @@ NOTE: If you use `spring-boot-starter-activemq`, the necessary dependencies to c ActiveMQ configuration is controlled by external configuration properties in `+spring.activemq.*+`. -By default an embedded broker is started, if you don't disable it explicitly and don't set the broker url. The broker -url is then autoconfigured to use the https://activemq.apache.org/vm-transport-reference.html[VM transport], which starts -an ActiveMQ broker in the same JVM instance. +By default, ActiveMQ is auto-configured to use the https://activemq.apache.org/vm-transport-reference.html[VM transport], which starts a broker embedded in the same JVM instance. + +You can disable the embedded broker by configuring the configprop:spring.activemq.in-memory[] property, as shown in the following example: -You can disable the embedded broker by declaring the following section in `application.properties`: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- spring: @@ -5858,7 +5857,7 @@ You can disable the embedded broker by declaring the following section in `appli in-memory: false ---- -or by setting the broker url explicitly: +The embedded broker will also be disabled if you configure the broker URL, as shown in the following example: [source,yaml,indent=0,configprops,configblocks] ---- @@ -5869,6 +5868,8 @@ or by setting the broker url explicitly: password: "secret" ---- +If you want to take full control over the embedded broker, refer to https://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html[the ActiveMQ documentation] for further information. + By default, a `CachingConnectionFactory` wraps the native `ConnectionFactory` with sensible settings that you can control by external configuration properties in `+spring.jms.*+`: [source,yaml,indent=0,configprops,configblocks]