Add "persistent" header to outbound STOMP messages

This commit is contained in:
Ville Skyttä 2016-01-27 19:09:19 +02:00 committed by Clebert Suconic
parent bdea213e88
commit 51f125387b
2 changed files with 3 additions and 0 deletions

View File

@ -123,6 +123,8 @@ public interface Stomp {
String SUBSCRIPTION = "subscription"; String SUBSCRIPTION = "subscription";
String ACK = "ack"; String ACK = "ack";
String PERSISTENT = "persistent";
} }
public interface Subscribe { public interface Subscribe {

View File

@ -92,6 +92,7 @@ public class StompUtils {
command.addHeader(Stomp.Headers.Message.EXPIRATION_TIME, "" + message.getExpiration()); command.addHeader(Stomp.Headers.Message.EXPIRATION_TIME, "" + message.getExpiration());
command.addHeader(Stomp.Headers.Message.REDELIVERED, String.valueOf(deliveryCount > 1)); command.addHeader(Stomp.Headers.Message.REDELIVERED, String.valueOf(deliveryCount > 1));
command.addHeader(Stomp.Headers.Message.PRIORITY, "" + message.getPriority()); command.addHeader(Stomp.Headers.Message.PRIORITY, "" + message.getPriority());
command.addHeader(Stomp.Headers.Message.PERSISTENT, "" + message.isDurable());
if (message.getStringProperty(ClientMessageImpl.REPLYTO_HEADER_NAME) != null) { if (message.getStringProperty(ClientMessageImpl.REPLYTO_HEADER_NAME) != null) {
command.addHeader(Stomp.Headers.Message.REPLY_TO, message.getStringProperty(ClientMessageImpl.REPLYTO_HEADER_NAME)); command.addHeader(Stomp.Headers.Message.REPLY_TO, message.getStringProperty(ClientMessageImpl.REPLYTO_HEADER_NAME));
} }