From 304ff797123be2f79db1abfdccd9b2374202a371 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Sat, 30 Mar 2019 14:36:02 -0500 Subject: [PATCH] ARTEMIS-2289 SUBSCRIBE w/receipt returns 2 receipt-ids --- .../protocol/stomp/VersionedStompFrameHandler.java | 3 --- .../tests/integration/stomp/v12/StompV12Test.java | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java index 75c1ea3cab..bac1c244f2 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java @@ -126,9 +126,6 @@ public abstract class VersionedStompFrameHandler { try { StompPostReceiptFunction postProcessFunction = onSubscribe(request); response = postprocess(request); - if (request.hasHeader(Stomp.Headers.RECEIPT_REQUESTED)) { - response.addHeader(Stomp.Headers.Response.RECEIPT_ID, request.getHeader(Stomp.Headers.RECEIPT_REQUESTED)); - } connection.sendFrame(response, postProcessFunction); return null; } catch (ActiveMQStompException e) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java index e3b61b3841..3e6e46c003 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java @@ -33,6 +33,7 @@ import java.util.UUID; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import java.util.regex.Pattern; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; @@ -97,6 +98,16 @@ public class StompV12Test extends StompTestBase { } } + @Test + public void testSubscribeWithReceipt() throws Exception { + conn.connect(defUser, defPass); + + Pattern p = Pattern.compile("receipt-id:.*\\nreceipt-id"); + assertFalse(p.matcher(subscribe(conn, null).toString()).find()); + + conn.disconnect(); + } + @Test public void testConnection() throws Exception { server.getSecurityStore().setSecurityEnabled(true);