Github user jbertram commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1830#discussion_r165095416
--- Diff:
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java
---
@@ -69,30 +49,29 @@ public SimpleString getAddress(int clientVersion) {
*/
public final List<SimpleString> convertQueueNames(int clientVersion,
List<SimpleString> queueNames) {
if (clientVersion < ADDRESSING_CHANGE_VERSION) {
- return applyAddressPrefixTo(queueNames);
- } else {
- return queueNames;
- }
- }
-
- private List<SimpleString> applyAddressPrefixTo(List<SimpleString>
queueNames) {
- final int names = queueNames.size();
- if (names == 0) {
- return Collections.emptyList();
- } else {
- final SimpleString address = this.address;
- final SimpleString prefix = jmsPrefixOf(address);
- if (prefix != null) {
- final List<SimpleString> prefixedQueueNames = new
ArrayList<>(names);
- for (int i = 0; i < names; i++) {
- final SimpleString oldQueueNames = queueNames.get(i);
- final SimpleString prefixedQueueName =
prefix.concat(oldQueueNames);
- prefixedQueueNames.add(prefixedQueueName);
- }
- return prefixedQueueNames;
+ final int names = queueNames.size();
--- End diff --
> The point of the JIRA is to allow old clients to continue using the old
address space. So, I should be able to configure a queue called "jms.queue.foo"
and have the old client connect to it. It should not matter what client or
protocol you are using.
That's correct, and that use-case should be supported by the PR.
> For this reason, we do not want to strip any prefix in the default case.
I.e. there is no prefix set on the acceptor (regardless of the client version).
There is no prefix stripping in this PR. The only thing that the version
check is for here is *adding* the prefix for older clients because they still
need it even if the acceptor is configured with the prefix. One important
change here is to check to see if the prefix is *already* present (e.g. in the
case where the address/queue is explicitly configured with it) in which case
the prefix won't be added (again).
---