activemq與spring整合配置

2021-07-03 07:07:06 字數 468 閱讀 2575

對於spring與activemq整合的配置,資料已經很多,不再贅述。我只闡述本人在學習中遇到的問題。

我在使用

spring與

activemq整合是遇到乙個問題.

問題:在使用發布/訂閱模式時,訊息持久化到資料庫。當客戶端掛掉後,然後重啟客戶端,然而重啟後的客戶端並未消費未消費的訊息。

解決:在配置

******messagelistenercontainer的引數時,設定durablesubscriptionname屬性,且值與clientid的值一致。

這時這個客戶端會消費

所有之前未消費的持久化訊息。

大概配置如下:

<?xml version="1.0" encoding="utf-8"?> 

" xmlns:xsi="

" xsi:schemalocation="

/spring-beans-3.0.xsd">   

ActiveMQ 與Spring的整合

一 簡單整合 1 新增依賴 org.apache.activemqgroupid activemq coreartifactid 5.7.0version dependency org.springframeworkgroupid spring jmsartifactid 5.1.5.release...

spring 專案整合ActiveMQ

org.apache.activemq activemq core 5.7.0 org.apache.activemq activemq pool 5.15.9 org.springframework spring jms 4.2.5.release 注意 這邊引入的依賴如果版本過高,在農汙專案中會...

使用 Spring 配置activemq

開發需要,所以了解了一些,整理一下作為筆記。1.首先匯入相應的xsi schemalocation,2.配置jms連線工廠 通過properties檔案來進行的配置 3.配置jms模板 queue spring 提供的jms工具類,用於傳送接收訊息 topic模板 connectionfactory...