> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/32.-messaging/32.1.-jms/32.1.1-activemq-support.md).

# 32.1.1 ActiveQ支持

如果ActiveMQ在类路径下，Spring Boot会配置一个`ConnectionFactory`。如果需要代理，将会开启一个内嵌的，已经自动配置好的代理（只要配置中没有指定代理URL）。

ActiveMQ是通过`spring.activemq.*`外部配置来控制的，例如，你可能在`application.properties`中声明以下片段：

```
spring.activemq.broker-url=tcp://192.168.1.210:9876
spring.activemq.user=admin
spring.activemq.password=secret
```

你也可以通过添加`org.apache.activemq:activemq-pool`来集合JMS资源，并如下配置`PooledConnectionFactory`。如下所示：

```
spring.activemq.pool.enabled=true
spring.activemq.pool.max-connections=50
```

具体参考[ActiveMQProperties](https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java)。你也可以注册任意数量的实现`ActiveMQConnectionFactoryCustomizer`的bean，来实现更多高级的自定义。

默认情况下，如果目标不存在，ActiveMQ将创建一个，所以目标是通过它们提供的名称解析出来的。
