private RoutingStatus handleManagementMessage(final Transaction tx, final Message message, final boolean direct) throws Exception { try { securityCheck(removePrefix(message.getAddressSimpleString()), CheckType.MANAGE, this); } catch (ActiveMQException e) { if (!autoCommitSends) { tx.markAsRollbackOnly(e); } throw e; } Message reply = managementService.handleMessage(message); SimpleString replyTo = message.getReplyTo(); if (replyTo != null) { // TODO: move this check somewhere else? this is a JMS-specific bit of logic in the core impl if (replyTo.toString().startsWith("queue://") || replyTo.toString().startsWith("topic://")) { replyTo = SimpleString.toSimpleString(replyTo.toString().substring(8)); } else if (replyTo.toString().startsWith("temp-queue://") || replyTo.toString().startsWith("temp-topic://")) { replyTo = SimpleString.toSimpleString(replyTo.toString().substring(13)); } reply.setAddress(replyTo); doSend(tx, reply, null, direct, false, routingContext); } return RoutingStatus.OK; }
@Override public synchronized RoutingStatus doSend(final Transaction tx, final Message msg, final SimpleString originalAddress, final boolean direct, final boolean noAutoCreateQueue, final RoutingContext routingContext) throws Exception { RoutingStatus result = RoutingStatus.OK; RoutingType routingType = msg.getRoutingType(); /* TODO-now: How to address here with AMQP? if (originalAddress != null) { if (originalAddress.toString().startsWith("anycast:")) { routingType = RoutingType.ANYCAST; } else if (originalAddress.toString().startsWith("multicast:")) { routingType = RoutingType.MULTICAST; } } */ AddressInfo art = getAddressAndRoutingType(new AddressInfo(msg.getAddressSimpleString(), routingType)); // Consumer // check the user has write access to this address. try { securityCheck(art.getName(), CheckType.SEND, this); } catch (ActiveMQException e) { if (!autoCommitSends && tx != null) { tx.markAsRollbackOnly(e);
result = doSend(tx, message, address, direct, noAutoCreateQueue, routingContext);