The Spring Boot documentation has this very brief illustration of an embedded JMS server: "Two beans that you don’t see defined are JmsTemplate and ConnectionFactory. These are created automatically by Spring Boot. In this case, the ActiveMQ broker runs embedded." Huh? The Reference Documentation doesn't say a thing about it. I need to create two VMs, each running from its own jar file, and I need one of them to launch an embedded JMS server, but I have no idea how to do this. Can somebody point me in the right direction. (If you provide a link, I would prefer some clear documentation over an example, but I'll be happy with a good example.)
Asked
Active
Viewed 334 times
1 Answers
0
You are looking at the wrong reference documentation. Yours is from Spring Integration.
The one of Spring Boot can be found here:
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-activemq
And there you will find the answer:
When 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).

Simon Martinelli
- 34,053
- 5
- 48
- 82
-
Thanks. I knew there was more documentation somewhere, and the other link is also called the "reference documentation." They should provide a link. – MiguelMunoz Sep 14 '18 at 16:58
-
Upon further reading, it's still not clear. The phrase "if a broker is present..." is rather vague. Present where? On the classpath? This means a broker must be different from ActiveMQ, or there would be no way to avoid an embedded broker. How do I put my broker on the classpath? (Is that where I'm supposed to put it?) Here's where a code example might be helpful. – MiguelMunoz Sep 14 '18 at 22:30
-
The documentation also fails to give me any details about the url of the embedded server, such as the port. If I specify a url, it will apparently take this to mean I don't want an embedded broker. Looking at the output of the application, it tells me it started a broker at this url: vm://localhost Trying to connect to vm://localhost gives me "unknown protocol." Trying tcp://localhost gives me "illegal port number: -1" Trying tcp://localhost:61616 gives me "Connection Refused," as does any other port number I've tried. The documentation is no help. – MiguelMunoz Sep 15 '18 at 05:30