Use an embed HornetQ broker by default

This commit changes the default behavior of the HornetQ auto
configuration. Prior to this commit, an embedded broker was only
started when it was requested explicitly by a configuration option.

This is inconsistent with the ActiveMQ support and boot favors the
easiest route. If the necessary classes are available, HornetQ is
embedded in the application by default.

Fixes gh-1029
This commit is contained in:
Stephane Nicoll
2014-06-04 20:15:35 +02:00
parent d6718025e6
commit 726991c144
5 changed files with 68 additions and 42 deletions

View File

@@ -256,7 +256,7 @@ content into your application; rather pick only the properties that you need.
spring.hornetq.embedded.data-directory= # location of data content (when persistence is enabled)
spring.hornetq.embedded.queues= # comma separate queues to create on startup
spring.hornetq.embedded.topics= # comma separate topics to create on startup
spring.hornetq.embedded.cluster-password = # customer password (randomly generated by default)
spring.hornetq.embedded.cluster-password= # customer password (randomly generated by default)
# JMS ({sc-spring-boot-autoconfigure}/jms/JmsTemplateProperties.{sc-ext}[JmsTemplateProperties])
spring.jms.pub-sub-domain= # false for queue (default), true for topic

View File

@@ -1702,11 +1702,14 @@ components require a `ConnectionFactory` to operate.
==== HornetQ support
Spring Boot can auto-configure a `ConnectionFactory` when it detects that
HornetQ is available on the classpath. By default, a `ConnectionFactory` using
the `netty` transport protocol is configured, connecting to a broker running on
the local machine with the default settings. It is also possible to connect to
a running broker provided in the container or even embed the container in the
application if the necessary classes are present.
HornetQ is available on the classpath. If the broker is present, an embedded
broker is started and configured automatically unless the mode property has
been explicitly set. The supported modes are: `embedded` (to make explicit
that an embedded broker is required and should lead to an error if the broker
is not available in the classpath), and `native` to connect to a broker
using the the `netty` transport protocol. When the latter is configured, boot
configures a `ConnectionFactory` connecting to a broker running on the local
machine with the default settings.
NOTE: if you are using `spring-boot-starter-hornetq` the necessary dependencies
to connect to an existing HornetQ instance are provided, as well as the Spring
@@ -1742,7 +1745,7 @@ names provided through configuration.
==== ActiveMQ support
Spring Boot can also configure a `ConnectionFactory` when it detects that
ActiveMQ is available on the classpath. If the complete broker is available,
ActiveMQ is available on the classpath. If the broker is present,
an embedded broker is started and configured automatically if no broker URL
is specified through configuration.