Do match message type
SimpMessageTypeMessageCondition was lenient in matching the message type, essentially matching on any non-null message type with an exact match given a preference only in comparing mulitple matches. This commit modifies matching logic to look for an exact match. Issue: SPR-16109
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -74,11 +74,8 @@ public class SimpMessageTypeMessageCondition extends AbstractMessageCondition<Si
|
||||
@Override
|
||||
@Nullable
|
||||
public SimpMessageTypeMessageCondition getMatchingCondition(Message<?> message) {
|
||||
Object actualMessageType = SimpMessageHeaderAccessor.getMessageType(message.getHeaders());
|
||||
if (actualMessageType == null) {
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
SimpMessageType actual = SimpMessageHeaderAccessor.getMessageType(message.getHeaders());
|
||||
return (actual != null && actual.equals(this.messageType) ? this : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user