spring_reference/IV. Spring Boot features/30.1.2. ActiveMQ support.md

14 lines
869 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 30.1.2. ActiveQ支持
如果发现ActiveMQ在classpath下可用Spring Boot会配置一个ConnectionFactory。如果需要代理将会开启一个内嵌的已经自动配置好的代理只要配置中没有指定代理URL
ActiveMQ配置是通过spring.activemq.*中的外部配置来控制的。例如你可能在application.properties中声明下面的片段
```java
spring.activemq.broker-url=tcp://192.168.1.210:9876
spring.activemq.user=admin
spring.activemq.password=secret
```
具体参考[ActiveMQProperties](http://github.com/spring-projects/spring-boot/tree/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java)。
默认情况下如果目标还不存在ActiveMQ将创建一个所以目标是通过它们提供的名称解析出来的。