The MESSAGE frame MUST include a destination header indicating the destination the message was sent to. If the message has been sent using STOMP, this destination header SHOULD be identical to the one used in the corresponding SEND frame.
The MESSAGE frame MUST also contain a message-id header with a unique identifier for that message and a subscription header matching the identifier of the subscription that is receiving the message.
The matching between the subscription and the message should be done using the subscription header. There is no guarantee that the destination header is identical to the one used in the Subscribe.
In the library, the SimplePathMatcher matches the destination header.
Another PathMatcher could be defined that uses the subscription header.
Unfortunately, the subscription id is not available outside the StompClient class.
Adding the following method to the StompClient would solve this issue:
public String getTopicId(String dest) {
return topics.get(dest);
}
A PathMatcher could then be defined using this method:
According to the Stomp specification,
The matching between the subscription and the message should be done using the subscription header. There is no guarantee that the destination header is identical to the one used in the Subscribe.
In the library, the SimplePathMatcher matches the destination header.
Another PathMatcher could be defined that uses the subscription header. Unfortunately, the subscription id is not available outside the StompClient class. Adding the following method to the StompClient would solve this issue:
A PathMatcher could then be defined using this method: