Adds a method to allow for sending a receipt on disconnect send.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1355553 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-06-29 20:26:32 +00:00
parent b7a1883b4b
commit 1e18cf2d71
1 changed files with 7 additions and 0 deletions

View File

@ -137,7 +137,14 @@ public class StompConnection {
}
public void disconnect() throws Exception {
disconnect(null);
}
public void disconnect(String receiptId) throws Exception {
StompFrame frame = new StompFrame("DISCONNECT");
if (receiptId != null && !receiptId.isEmpty()) {
frame.getHeaders().put(Stomp.Headers.RECEIPT_REQUESTED, receiptId);
}
sendFrame(frame.format());
}