ARTEMIS-1612 - strip any acceptor matching prefix from the message address such that further routing will match the lack of prefixes in broker routing, different fix for redistribution with prefixes

This commit is contained in:
gtully 2021-07-27 12:44:05 +01:00 committed by Gary Tully
parent e985df77fb
commit b27aa03a37
2 changed files with 8 additions and 1 deletions

View File

@ -2166,7 +2166,12 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
}
} */
AddressInfo art = getAddressAndRoutingType(new AddressInfo(msg.getAddressSimpleString(), routingType));
final AddressInfo targetFromMessage = new AddressInfo(msg.getAddressSimpleString(), routingType);
AddressInfo art = getAddressAndRoutingType(targetFromMessage);
if (art != targetFromMessage) {
// remove the prefix from the message, with the address model change, only non prefixed addresses exist on the broker
msg.setAddress(art.getName());
}
// check the user has write access to this address.
try {

View File

@ -258,6 +258,8 @@ public class CoreClientTest extends ActiveMQTestBase {
for (int i = 0; i < numMessages / anycastPrefixes.size(); i++) {
ClientMessage message = consumer.receive(1000);
assertNotNull(message);
// this seems to be the only assert of this non requirement
assertFalse(message.getAddress().contains(queuePrefix));
message.acknowledge();
}
assertNull(consumer.receiveImmediate());