clebertsuconic commented on code in PR #4502:
URL: https://github.com/apache/activemq-artemis/pull/4502#discussion_r1222058347
##########
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java:
##########
@@ -928,6 +917,35 @@ private ActiveMQMessageConsumer createConsumer(final
ActiveMQDestination dest,
}
}
+ private SimpleString createFullyQualifedNamedQueue(ActiveMQDestination dest,
+ SimpleString coreFilterString,
+ AddressQuery response) throws
ActiveMQException, JMSException {
+ SimpleString queueName;
+ queueName = CompositeAddress.extractQueueName(dest.getSimpleAddress());
+ if (!response.isExists() ||
!response.getQueueNames().contains(AutoCreateUtil.getCoreQueueName(session,
dest.getSimpleAddress()))) {
+ if (response.isAutoCreateQueues()) {
+ try {
+ createQueue(dest, RoutingType.MULTICAST,
dest.getSimpleAddress(), coreFilterString, true, true, response);
+ } catch (ActiveMQQueueExistsException e) {
+ // The queue was created by another client/admin between the
query check and send create queue packet
+ }
+ } else {
+ throw new InvalidDestinationException("Destination " +
dest.getName() + " does not exist");
+ }
+ } else {
+ QueueQuery queueQuery = session.queueQuery(queueName);
+
+ if (!queueQuery.isExists()) {
+ throw new InvalidDestinationException("Destination " + queueName +
" does not exist");
+ }
+
+ if (coreFilterString != null &&
!queueQuery.getFilterString().equals(coreFilterString)) {
Review Comment:
I am going to allow to not define the selector on the consumer or on the
queue. and I added tests for that.
it will be more permissive and it will still validate the case of a
different filter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]