private Queue findOrCreateQueue(BindingQueryResult bindingQueryResult, AddressInfo addressInfo, SimpleString queue, int qos) throws Exception { if (addressInfo.getRoutingTypes().contains(RoutingType.MULTICAST)) { return session.getServerSession().createQueue(addressInfo.getName(), queue, RoutingType.MULTICAST, managementFilter, false, MQTTUtil.DURABLE_MESSAGES && qos >= 0, false); } if (addressInfo.getRoutingTypes().contains(RoutingType.ANYCAST)) { if (!bindingQueryResult.getQueueNames().isEmpty()) { SimpleString name = null; for (SimpleString qName : bindingQueryResult.getQueueNames()) { if (name == null) { name = qName; } else if (qName.equals(addressInfo.getName())) { name = qName; } } return session.getServer().locateQueue(name); } else { try { return session.getServerSession().createQueue(addressInfo.getName(), addressInfo.getName(), RoutingType.ANYCAST, managementFilter, false, MQTTUtil.DURABLE_MESSAGES && qos >= 0, false); } catch (ActiveMQQueueExistsException e) { return session.getServer().locateQueue(addressInfo.getName()); } } } Set<RoutingType> routingTypeSet = new HashSet(); routingTypeSet.add(RoutingType.MULTICAST); routingTypeSet.add(RoutingType.ANYCAST); throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeForAddress(addressInfo.getRoutingType(), addressInfo.getName().toString(), routingTypeSet); }
private Queue findOrCreateQueue(BindingQueryResult bindingQueryResult, AddressInfo addressInfo, SimpleString queue, int qos) throws Exception { if (addressInfo.getRoutingTypes().contains(RoutingType.MULTICAST)) { return session.getServerSession().createQueue(addressInfo.getName(), queue, RoutingType.MULTICAST, managementFilter, false, MQTTUtil.DURABLE_MESSAGES && qos >= 0, false); } if (addressInfo.getRoutingTypes().contains(RoutingType.ANYCAST)) { if (!bindingQueryResult.getQueueNames().isEmpty()) { SimpleString name = null; for (SimpleString qName : bindingQueryResult.getQueueNames()) { if (name == null) { name = qName; } else if (qName.equals(addressInfo.getName())) { name = qName; } } return session.getServer().locateQueue(name); } else { try { return session.getServerSession().createQueue(addressInfo.getName(), addressInfo.getName(), RoutingType.ANYCAST, managementFilter, false, MQTTUtil.DURABLE_MESSAGES && qos >= 0, false); } catch (ActiveMQQueueExistsException e) { return session.getServer().locateQueue(addressInfo.getName()); } } } Set<RoutingType> routingTypeSet = new HashSet(); routingTypeSet.add(RoutingType.MULTICAST); routingTypeSet.add(RoutingType.ANYCAST); throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeForAddress(addressInfo.getRoutingType(), addressInfo.getName().toString(), routingTypeSet); }
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressToUse); } else if (!info.getRoutingTypes().contains(rt)) { throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeForAddress(rt, info.getName().toString(), info.getRoutingTypes());