Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1ED51200D55 for ; Sat, 9 Dec 2017 15:25:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1D48A160C0E; Sat, 9 Dec 2017 14:25:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E2039160C03 for ; Sat, 9 Dec 2017 15:25:05 +0100 (CET) Received: (qmail 67672 invoked by uid 500); 9 Dec 2017 14:25:05 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 67663 invoked by uid 99); 9 Dec 2017 14:25:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Dec 2017 14:25:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A5F9D1A0679 for ; Sat, 9 Dec 2017 14:25:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id CNFWO5Y3z8pj for ; Sat, 9 Dec 2017 14:25:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1C29C5F297 for ; Sat, 9 Dec 2017 14:25:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8C6FDE05C1 for ; Sat, 9 Dec 2017 14:25:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2A2B2212FC for ; Sat, 9 Dec 2017 14:25:00 +0000 (UTC) Date: Sat, 9 Dec 2017 14:25:00 +0000 (UTC) From: "Todd Baert (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ARTEMIS-1549) AMQP messages aren't redistributed across cluster bridge, NPE in ServerSessionImpl.send() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 09 Dec 2017 14:25:07 -0000 [ https://issues.apache.org/jira/browse/ARTEMIS-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Todd Baert updated ARTEMIS-1549: -------------------------------- Description: I have setup a cluster of 2 brokers, using a simple static cluster configuration (see below). Sending a CORE message to broker1, and consuming that message from broker2 works as expected. Attempting the same over AMQP (using the AMQP .Net Lite client) results in an NPE in broker2: {code:none} 08:44:28,061 ERROR [org.apache.activemq.artemis.core.server] AMQ224016: Caught exception: java.lang.NullPointerException at org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage.setAddress(AMQPMessage.java:613) [artemis-amqp-protocol-2.3.0.jar:] at org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage.setAddress(AMQPMessage.java:64) [artemis-amqp-protocol-2.3.0.jar:] at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1348) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1309) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1302) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.onSessionSend(ServerSessionPacketHandler.java:690) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.onMessagePacket(ServerSessionPacketHandler.java:290) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:33) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.3.0.jar:2.3.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151] at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151] {code} To be clear, the NPE exists on the broker to which the receiver is attached, every time a message is SENT by the producer (which is attached to the other broker). Attempting to send/receive the AMQP messages on the same cluster member works as expected. Here is some client code that demonstrates the issue: {code:java} using System; using System.Collections.Generic; using System.Threading; using System.Transactions; using Amqp; using Amqp.Framing; using Amqp.Sasl; using Amqp.Types; namespace Test { class Program { static void Main(string[] args) { string url1 = "amqp://localhost:5672"; string url2 = "amqp://localhost:5673"; String ADDRESS = "orders"; Connection connection1 = new Connection(new Address(url1)); Session session1 = new Session(connection1); ReceiverLink receiver = new ReceiverLink(session1, "sub1", CreateSharedDurableSubscriberSource(ADDRESS), null); Connection connection2 = new Connection(new Address(url2)); Session session2 = new Session(connection2); SenderLink sender = new SenderLink(session2, "sender", ADDRESS); receiver.Start(300, (r, m) => { r.Accept(m); Console.WriteLine("Got message: " + m.Body); }); Message outMessage = new Message("order placed at " + DateTime.Now.ToString()); outMessage.Header = new Header(); outMessage.Header.Durable = true; sender.Send(outMessage); Thread.CurrentThread.Join(); } private static Source CreateSharedDurableSubscriberSource(String address) { Source source = new Source(); source.Address = address; source.ExpiryPolicy = new Symbol("never"); source.Durable = 2; source.Capabilities = new Symbol[]{"topic", "shared", "global"}; source.DistributionMode = new Symbol("copy"); return source; } } } {code} Here is the cluster config from broker1, broker2 is configured accordingly {code:xml} tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300 tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300 tcp://localhost:61616 tcp://localhost:61617 todd password broker1-connector 500 true ON_DEMAND 1 broker2-connector {code} message-load-balancing has no effect on this issue, redistributiuon-delay is set to 0 for the address in question. was: I have setup a cluster of 2 brokers, using a simple static cluster configuration (see below). Sending a CORE message to broker1, and consuming that message from broker2 works as expected. Attempting the same over AMQP (using the AMQP .Net Lite client) results in an NPE in broker2: {code:none} 08:44:28,061 ERROR [org.apache.activemq.artemis.core.server] AMQ224016: Caught exception: java.lang.NullPointerException at org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage.setAddress(AMQPMessage.java:613) [artemis-amqp-protocol-2.3.0.jar:] at org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage.setAddress(AMQPMessage.java:64) [artemis-amqp-protocol-2.3.0.jar:] at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1348) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1309) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1302) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.onSessionSend(ServerSessionPacketHandler.java:690) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.onMessagePacket(ServerSessionPacketHandler.java:290) [artemis-server-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:33) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) [artemis-commons-2.3.0.jar:2.3.0] at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.3.0.jar:2.3.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151] at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151] {code} To be clear, the NPE exists on the broker to which the receiver is attached, every time a message is SENT by the producer (which is attached to the other broker). Attempting to send/receive the AMQP messages on the same cluster member works as expected. Here is some client code that demonstrates the issue: {code:java} using System; using System.Collections.Generic; using System.Threading; using System.Transactions; using Amqp; using Amqp.Framing; using Amqp.Sasl; using Amqp.Types; namespace Test { class Program { static void Main(string[] args) { string url1 = "amqp://localhost:5672"; string url2 = "amqp://localhost:5673"; String ADDRESS = "orders"; Connection connection1 = new Connection(new Address(url1)); Session session1 = new Session(connection1); ReceiverLink receiver = new ReceiverLink(session1, "sub1", CreateSharedDurableSubscriberSource(ADDRESS), null); Connection connection2 = new Connection(new Address(url2)); Session session2 = new Session(connection2); SenderLink sender = new SenderLink(session2, "sender", ADDRESS); receiver.Start(300, (r, m) => { r.Accept(m); Console.WriteLine("Got message: " + m.Body); }); Message outMessage = new Message("order placed at " + DateTime.Now.ToString()); outMessage.Header = new Header(); outMessage.Header.Durable = true; sender.Send(outMessage); Thread.CurrentThread.Join(); } private static Source CreateSharedDurableSubscriberSource(String address) { Source source = new Source(); source.Address = address; source.ExpiryPolicy = new Symbol("never"); source.Durable = 2; source.Capabilities = new Symbol[]{"topic", "shared", "global"}; source.DistributionMode = new Symbol("copy"); return source; } } } {code} Here is the cluster config from broker1, broker2 is configured accordingly {code:xml} tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300 tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300 tcp://localhost:61616 tcp://localhost:61617 todd password broker1-connector 500 true ON_DEMAND 1 broker2-connector {code} Message load balancing has no effect on this issue, redistributiuon-delay is set to 0 for the address in question. > AMQP messages aren't redistributed across cluster bridge, NPE in ServerSessionImpl.send() > ----------------------------------------------------------------------------------------- > > Key: ARTEMIS-1549 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1549 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: AMQP, Broker > Affects Versions: 2.2.0, 2.3.0, 2.4.0 > Environment: AMQP .NET lite client, .NET Core runtime 2.0, connecting with brokers on local machine (fedora 26) > Reporter: Todd Baert > > I have setup a cluster of 2 brokers, using a simple static cluster configuration (see below). Sending a CORE message to broker1, and consuming that message from broker2 works as expected. Attempting the same over AMQP (using the AMQP .Net Lite client) results in an NPE in broker2: > {code:none} > 08:44:28,061 ERROR [org.apache.activemq.artemis.core.server] AMQ224016: Caught exception: java.lang.NullPointerException > at org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage.setAddress(AMQPMessage.java:613) [artemis-amqp-protocol-2.3.0.jar:] > at org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage.setAddress(AMQPMessage.java:64) [artemis-amqp-protocol-2.3.0.jar:] > at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1348) [artemis-server-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1309) [artemis-server-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1302) [artemis-server-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.onSessionSend(ServerSessionPacketHandler.java:690) [artemis-server-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.onMessagePacket(ServerSessionPacketHandler.java:290) [artemis-server-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:33) [artemis-commons-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) [artemis-commons-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) [artemis-commons-2.3.0.jar:2.3.0] > at org.apache.activemq.artemis.utils.actors.ProcessorBase$ExecutorTask.run(ProcessorBase.java:53) [artemis-commons-2.3.0.jar:2.3.0] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151] > at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151] > {code} > To be clear, the NPE exists on the broker to which the receiver is attached, every time a message is SENT by the producer (which is attached to the other broker). > Attempting to send/receive the AMQP messages on the same cluster member works as expected. > Here is some client code that demonstrates the issue: > {code:java} > using System; > using System.Collections.Generic; > using System.Threading; > using System.Transactions; > using Amqp; > using Amqp.Framing; > using Amqp.Sasl; > using Amqp.Types; > namespace Test > { > class Program > { > static void Main(string[] args) > { > string url1 = "amqp://localhost:5672"; > string url2 = "amqp://localhost:5673"; > String ADDRESS = "orders"; > Connection connection1 = new Connection(new Address(url1)); > Session session1 = new Session(connection1); > ReceiverLink receiver = new ReceiverLink(session1, "sub1", CreateSharedDurableSubscriberSource(ADDRESS), null); > Connection connection2 = new Connection(new Address(url2)); > Session session2 = new Session(connection2); > SenderLink sender = new SenderLink(session2, "sender", ADDRESS); > receiver.Start(300, (r, m) => { > r.Accept(m); > Console.WriteLine("Got message: " + m.Body); > }); > > Message outMessage = new Message("order placed at " + DateTime.Now.ToString()); > outMessage.Header = new Header(); > outMessage.Header.Durable = true; > sender.Send(outMessage); > Thread.CurrentThread.Join(); > } > private static Source CreateSharedDurableSubscriberSource(String address) > { > Source source = new Source(); > source.Address = address; > source.ExpiryPolicy = new Symbol("never"); > > source.Durable = 2; > source.Capabilities = new Symbol[]{"topic", "shared", "global"}; > source.DistributionMode = new Symbol("copy"); > return source; > } > } > } > {code} > Here is the cluster config from broker1, broker2 is configured accordingly > {code:xml} > > tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300 > tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300 > > > tcp://localhost:61616 > tcp://localhost:61617 > > todd > password > > > broker1-connector > 500 > true > ON_DEMAND > 1 > > broker2-connector > > > > {code} > message-load-balancing has no effect on this issue, redistributiuon-delay is set to 0 for the address in question. -- This message was sent by Atlassian JIRA (v6.4.14#64029)