This commit is contained in:
Howard Gao 2019-04-02 14:14:21 +08:00
commit 279f65586d
2 changed files with 11 additions and 3 deletions

View File

@ -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) {

View File

@ -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);