AMQ-7012 Fix STOMP protocol handler to log correct command names

Ensure Commands are logged correctly by the protocol converter.
(cherry picked from commit 5fb470478f)
This commit is contained in:
Timothy Bish 2018-07-19 17:29:06 -04:00
parent 4bcc991d72
commit ed3c4fec89
2 changed files with 14 additions and 4 deletions

View File

@ -257,9 +257,9 @@ public class ProtocolConverter {
onStompCommit(command);
} else if (action.startsWith(Stomp.Commands.ABORT)) {
onStompAbort(command);
} else if (action.startsWith(Stomp.Commands.SUBSCRIBE)) {
} else if (action.startsWith(Stomp.Commands.SUBSCRIBE_PREFIX)) {
onStompSubscribe(command);
} else if (action.startsWith(Stomp.Commands.UNSUBSCRIBE)) {
} else if (action.startsWith(Stomp.Commands.UNSUBSCRIBE_PREFIX)) {
onStompUnsubscribe(command);
} else if (action.startsWith(Stomp.Commands.CONNECT) ||
action.startsWith(Stomp.Commands.STOMP)) {
@ -1031,6 +1031,10 @@ public class ProtocolConverter {
case Stomp.Commands.DISCONNECT:
result = action;
break;
case Stomp.Commands.SUBSCRIBE_PREFIX:
result = Stomp.Commands.SUBSCRIBE;
case Stomp.Commands.UNSUBSCRIBE_PREFIX:
result = Stomp.Commands.UNSUBSCRIBE;
default:
break;
}

View File

@ -49,8 +49,14 @@ public interface Stomp {
String CONNECT = "CONNECT";
String SEND = "SEND";
String DISCONNECT = "DISCONNECT";
String SUBSCRIBE = "SUB";
String UNSUBSCRIBE = "UNSUB";
String SUBSCRIBE = "SUBSCRIBE";
String UNSUBSCRIBE = "UNSUBSCRIBE";
// Preserve legacy incorrect allow shortened names for
// subscribe and un-subscribe as it has been there for so
// long that someone has undoubtedly come to expect it.
String SUBSCRIBE_PREFIX = "SUB";
String UNSUBSCRIBE_PREFIX = "UNSUB";
String BEGIN_TRANSACTION = "BEGIN";
String COMMIT_TRANSACTION = "COMMIT";