ARTEMIS-885 Fix OpenWire wildcard conversion issue
This commit is contained in:
parent
656eee79e4
commit
d67ea071a3
|
@ -97,7 +97,7 @@ public class AMQConsumer {
|
|||
serverConsumer = session.getCoreSession().createConsumer(nativeId, queueName, null, info.isBrowser(), false, -1);
|
||||
serverConsumer.setlowConsumerDetection(slowConsumerDetectionListener);
|
||||
} else {
|
||||
SimpleString queueName = new SimpleString(openwireDestination.getPhysicalName());
|
||||
SimpleString queueName = new SimpleString(OpenWireUtil.convertWildcard(openwireDestination.getPhysicalName()));
|
||||
try {
|
||||
session.getCoreServer().createQueue(queueName, RoutingType.ANYCAST, queueName, null, true, false);
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.postoffice.RoutingStatus;
|
|||
import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection;
|
||||
import org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverter;
|
||||
import org.apache.activemq.artemis.core.protocol.openwire.OpenWireProtocolManager;
|
||||
import org.apache.activemq.artemis.core.protocol.openwire.util.OpenWireUtil;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||
import org.apache.activemq.artemis.core.server.BindingQueryResult;
|
||||
|
@ -150,7 +151,7 @@ public class AMQSession implements SessionCallback {
|
|||
|
||||
for (ActiveMQDestination openWireDest : dests) {
|
||||
if (openWireDest.isQueue()) {
|
||||
SimpleString queueName = new SimpleString(openWireDest.getPhysicalName());
|
||||
SimpleString queueName = new SimpleString(OpenWireUtil.convertWildcard(openWireDest.getPhysicalName()));
|
||||
|
||||
if (!checkAutoCreateQueue(queueName, openWireDest.isTemporary())) {
|
||||
throw new InvalidDestinationException("Destination doesn't exist: " + queueName);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class OpenWireTestBase extends ActiveMQTestBase {
|
|||
|
||||
Configuration serverConfig = server.getConfiguration();
|
||||
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
|
||||
serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")).setAutoCreateAddresses(true));
|
||||
|
||||
serverConfig.setSecurityEnabled(enableSecurity);
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.tests.integration.openwire.amq;
|
||||
|
||||
import org.apache.activemq.artemis.core.config.Configuration;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||
|
||||
import javax.jms.DeliveryMode;
|
||||
|
||||
/**
|
||||
|
@ -39,4 +42,13 @@ public class JmsDurableQueueWildcardSendReceiveTest extends JmsTopicSendReceiveT
|
|||
protected String getProducerSubject() {
|
||||
return "FOO.BAR.HUMBUG";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void extraServerConfig(Configuration serverConfig) {
|
||||
AddressSettings settings = serverConfig.getAddressesSettings().get("#");
|
||||
if (settings != null) {
|
||||
settings.setAutoCreateQueues(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue