application.properties文件配置:
#服務端口,8080被另一服務占用
server.port=9090
spring.activemq.broker-url=tcp://127.0.0.1:61616
# 在考慮結束之前等待的時間
#spring.activemq.close-timeout=15s
# 默認代理URL是否應該在內存中。如果指定了顯式代理,則忽略此值。
spring.activemq.in-memory=true
# 是否在回滾回滾消息之前停止消息傳遞。這意味着當啟用此命令時,消息順序不會被保留。
spring.activemq.non-blocking-redelivery=false
# 等待消息發送響應的時間。設置為0等待永遠。
spring.activemq.send-timeout=0
#默認情況下activemq提供的是queue模式,若要使用topic模式需要配置下面配置
spring.jms.pub-sub-domain=true
#賬號
spring.activemq.user=admin
# 密碼
spring.activemq.password=admin
# 是否信任所有包
#spring.activemq.packages.trust-all=
# 要信任的特定包的逗號分隔列表(當不信任所有包時)
#spring.activemq.packages.trusted=
# 當連接請求和池滿時是否阻塞。設置false會拋“JMSException異常”。
#spring.activemq.pool.block-if-full=true
# 如果池仍然滿,則在拋出異常前阻塞時間。
#spring.activemq.pool.block-if-full-timeout=-1ms
# 是否在啟動時創建連接。可以在啟動時用於加熱池。
#spring.activemq.pool.create-connection-on-startup=true
# 是否用Pooledconnectionfactory代替普通的ConnectionFactory。
#spring.activemq.pool.enabled=false
# 連接過期超時。
#spring.activemq.pool.expiry-timeout=0ms
# 連接空閑超時
#spring.activemq.pool.idle-timeout=30s
# 連接池最大連接數
#spring.activemq.pool.max-connections=1
# 每個連接的有效會話的最大數目。
#spring.activemq.pool.maximum-active-session-per-connection=500
# 當有"JMSException"時嘗試重新連接
#spring.activemq.pool.reconnect-on-exception=true
# 在空閑連接清除線程之間運行的時間。當為負數時,沒有空閑連接驅逐線程運行。
#spring.activemq.pool.time-between-expiration-check=-1ms
# 是否只使用一個MessageProducer
#spring.activemq.pool.use-anonymous-producers=true