Skip to content

Commit 0b48b98

Browse files
authored
Update 32.1.2 Artemis support.md
1 parent 1fc56ca commit 0b48b98

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
###32.1.2 Artemis support
1+
###32.1.2 Artemis支持
2+
Apache Artemis成立于2015年,那时HornetQ刚捐给Apache基金会,确保别使用了过期的HornetQ支持。
3+
**** 不要尝试同时使用Artemis和HornetQ。
4+
5+
如果发现classpath下存在Artemis依赖,Spring Boot将自动配置一个`ConnectionFactory`。如果需要broker,Spring Boot将启动内嵌的broker,并对其自动配置(除非模式mode属性被显式设置)。支持的modes包括:`embedded`(明确需要内嵌broker,如果classpath下不存在则出错),`native`(使用`netty`传输协议连接broker)。当配置`native`模式,Spring Boot将配置一个连接broker的`ConnectionFactory`,该broker使用默认的设置运行在本地机器。
6+
**** 使用`spring-boot-starter-artemis` 'Starter',则连接已存在的Artemis实例及Spring设施集成JMS所需依赖都会提供,添加`org.apache.activemq:artemis-jms-server`依赖,你可以使用内嵌模式。
7+
8+
Artemis配置控制在外部配置属性`spring.artemis.*`中,例如,在`application.properties`声明以下片段:
9+
```properties
10+
spring.artemis.mode=native
11+
spring.artemis.host=192.168.1.210
12+
spring.artemis.port=9876
13+
spring.artemis.user=admin
14+
spring.artemis.password=secret
15+
```
16+
当使用内嵌模式时,你可以选择是否启用持久化,及目的地列表。这些可以通过逗号分割的列表来指定,也可以分别定义`org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration``org.apache.activemq.artemis.jms.server.config.TopicConfiguration`类型的bean来进一步配置队列和topic,具体支持选项可参考[ArtemisProperties](https://github.com/spring-projects/spring-boot/tree/v1.4.1.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java)

0 commit comments

Comments
 (0)