From users-return-50732-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Fri Nov 30 14:30:39 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F0790180671 for ; Fri, 30 Nov 2018 14:30:38 +0100 (CET) Received: (qmail 23513 invoked by uid 500); 30 Nov 2018 13:30:37 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 23502 invoked by uid 99); 30 Nov 2018 13:30:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2018 13:30:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BE2C8C63F3 for ; Fri, 30 Nov 2018 13:30:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.775 X-Spam-Level: ** X-Spam-Status: No, score=2.775 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, SPF_HELO_PASS=-0.001, URI_HEX=1.313, URI_TRY_3LD=0.463] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id PifcEnrfYVpm for ; Fri, 30 Nov 2018 13:30:35 +0000 (UTC) Received: from n4.nabble.com (n4.nabble.com [199.38.86.66]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A31275FE6C for ; Fri, 30 Nov 2018 13:30:34 +0000 (UTC) Received: from n4.nabble.com (localhost [127.0.0.1]) by n4.nabble.com (Postfix) with ESMTP id 8F26835423AB for ; Fri, 30 Nov 2018 07:30:28 -0600 (CST) Date: Fri, 30 Nov 2018 07:30:28 -0600 (CST) From: PedroRP To: users@activemq.apache.org Message-ID: <1543584628584-0.post@n4.nabble.com> In-Reply-To: References: <1543510226418-0.post@n4.nabble.com> Subject: Re: ActiveMQ HA on failover topic mode MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit We have used Spring boot to develop sender and consumer apps. *SENDER:* To send messages we used and API REST that sends 5000 messages to a topic. If some convertAndSend fails (ActiveMQ node 1 killed) we retry it until the failover. This is my sender class: @RestController public class RestApiController { @Autowired private JmsTemplate jmsTemplate; @RequestMapping(value = "/produce") public String produce() { String result = "Done"; for (int i = 0; i < 5000; i++) { boolean repetir = true; while (repetir) { try { jmsTemplate.convertAndSend("TestTopic", "Message " + i); repetir = false; result = "Done"; } catch (JmsException e) { e.printStackTrace(); result = "ERROR"; } } } return result; } } This is de sender's application.properties: spring.activemq.broker-url=failover:(tcp://172.18.13.45:61616,tcp://172.18.13.45:61626)?initialReconnectDelay=1&backup=true spring.activemq.user=admin spring.activemq.password=admin spring.jms.pub-sub-domain=true server.port=8081 CONSUMER: This is my listener class: @Service public class ContactTransactionReceiver { @JmsListener(destination = "TestTopic") public void receiveMessageSendMessage(Message message) throws Exception { System.out.println(((TextMessage) message).getText()); } } This is the consumer's application.properties: spring.activemq.broker-url=failover:(tcp://172.18.13.45:61616,tcp://172.18.13.45:61626)?initialReconnectDelay=1&backup=true spring.activemq.user=admin spring.activemq.password=admin spring.jms.pub-sub-domain=true server.port=8082 *ACTIVEMQ NODE 1* We have included this configuration in activemq.xml for HA, that refers to node2: We have proved too master-slave: *ACTIVEMQ NODE 2* We have included this configuration in activemq.xml for HA, that refers to node2: We have proved too master-slave: We have made test with durable messages and subscriptions wit we got the same problem. Moreover, we also proved including networkTTL="2" messageTTL="2" consumerTTL="2" and alwaysSyncSend="true" in both networkConnectors but the same result. You can find the full code and ActiveMQ configuration files in: https://github.com/PedroRamirezTOR/ActiveMQ-HA-Sender-Consumer.git Thanks in advance! -- Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html