如果目标不可用,ActiveMQ Producer将重新发送

时间:2015-10-15 12:52:12

标签: java activemq failover

我正在使用最新的ActiveMQ和持久性,我已经实现了正在按预期工作的生产者和消费者。但是,当消费者从停机状态恢复时,我无法让生产者重新发送消息。它只在消费者备份后才开始发送消息。

生产者

DeliveryMode.PERSISTENT

我想要实现的是让生产者重新发送消费者关闭时未能提供的消息。举个例子:生产者发送消息1,2消费者接收它们然后它就会脱机。当消费者离线时,制作人发送3,4,消息应该存储,直到消费者可用,并且3,4被重新发送给消费者接收。

我已阅读http://activemq.apache.org/how-do-durable-queues-and-topics-work.html并使用package testNGTestPack; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.testng.annotations.Parameters; import org.testng.annotations.Test; public class VerifyTitle { WebDriver driver; @Test @Parameters("browserName") public void verifyTitle(String browserName){ if(browserName.equalsIgnoreCase("firebox")) { driver=new FirefoxDriver(); } else if(browserName.equalsIgnoreCase("chrome")){ System.setProperty("webdriver.chrome.driver", "D:\\driver\\chromedriver.exe"); driver = new ChromeDriver(); } else if(browserName.equalsIgnoreCase("IE")){ System.setProperty("webdriver.ie.driver", "D:\\driver\\IEDriverServer.exe"); driver=new InternetExplorerDriver(); } driver.manage().window().maximize(); driver.get("http://www.facebook.com"); //driver.quit(); } } 启用了持久队列,但重新连接时不会重新发送消息。

任何想法?

0 个答案:

没有答案