/** * Normalizes the destination name. * <p/> * This ensures the destination name is correct, and we do not create queues as <tt>queue://queue:foo</tt>, which * was intended as <tt>queue://foo</tt>. * * @param destination the destination * @return the normalized destination */ public static String normalizeDestinationName(String destination) { // do not include prefix which is the current behavior when using this method. return normalizeDestinationName(destination, false); }
/** * Provides an explicit ReplyTo destination, which overrides any incoming value of Message.getJMSReplyTo(). */ public void setReplyTo(String replyToDestination) { this.replyTo = normalizeDestinationName(replyToDestination); }
/** * Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. * It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination. */ public void setReplyToOverride(String replyToDestination) { this.replyToOverride = normalizeDestinationName(replyToDestination); }
/** * Gets the destination name which was configured from the endpoint uri. * * @return the destination name resolved from the endpoint uri */ public String getEndpointConfiguredDestinationName() { String remainder = StringHelper.after(getEndpointKey(), "//"); if (remainder != null && remainder.contains("?")) { // remove parameters remainder = StringHelper.before(remainder, "?"); } return JmsMessageHelper.normalizeDestinationName(remainder); }
protected Destination resolveOrCreateDestination(String destinationName, Session session) throws JMSException { Destination dest = null; boolean isPubSub = isTopicPrefix(destinationName) || (!isQueuePrefix(destinationName) && endpoint.isPubSubDomain()); // try using destination resolver to lookup the destination if (endpoint.getDestinationResolver() != null) { dest = endpoint.getDestinationResolver().resolveDestinationName(session, destinationName, isPubSub); if (LOG.isDebugEnabled()) { LOG.debug("Resolved JMSReplyTo destination {} using DestinationResolver {} as PubSubDomain {} -> {}", new Object[] {destinationName, endpoint.getDestinationResolver(), isPubSub, dest}); } } if (dest == null) { // must normalize the destination name String before = destinationName; destinationName = normalizeDestinationName(destinationName); LOG.trace("Normalized JMSReplyTo destination name {} -> {}", before, destinationName); // okay then fallback and create the queue/topic if (isPubSub) { LOG.debug("Creating JMSReplyTo topic: {}", destinationName); dest = session.createTopic(destinationName); } else { LOG.debug("Creating JMSReplyTo queue: {}", destinationName); dest = session.createQueue(destinationName); } } return dest; }
headerValue = normalizeDestinationName((String) headerValue, true);