Package org.apache.qpid.transport

Examples of org.apache.qpid.transport.ReplyTo


            {
                props.setMessageId("ID:" + messageProps.getMessageId().toString());
            }
            if(messageProps.hasReplyTo())
            {
                ReplyTo replyTo = messageProps.getReplyTo();
                String exchangeName = replyTo.getExchange();
                String routingKey = replyTo.getRoutingKey();
                if(exchangeName == null)
                {
                    exchangeName = "";
                }
View Full Code Here


            messageProps.setCorrelationId(origHeader.getCorrelationId().getBytes());
        }
        final String origReplyTo = origHeader.getReplyTo();
        if(origReplyTo != null && !origReplyTo.equals(""))
        {
            ReplyTo replyTo;
            if(origReplyTo.startsWith("/"))
            {
                replyTo = new ReplyTo("",origReplyTo);
            }
            else if(origReplyTo.contains("/"))
            {
                String[] parts = origReplyTo.split("/",2);
                replyTo = new ReplyTo(parts[0],parts[1]);
            }
            else if(vhost.getExchange(origReplyTo) != null)
            {
                replyTo = new ReplyTo(origReplyTo,"");
            }
            else
            {
                replyTo = new ReplyTo("",origReplyTo);
            }
            messageProps.setReplyTo(replyTo);
        }

        messageProps.setApplicationHeaders(serverMsg.getMessageHeader().getHeadersAsMap());
View Full Code Here

        }

        if(properties.getReplyTo() != null && properties.getReplyTo().length() != 0)
        {
            String origReplyToString = properties.getReplyTo().asString();
            ReplyTo replyTo = new ReplyTo();
            // if the string looks like a binding URL, then attempt to parse it...
            try
            {
                AMQBindingURL burl = new AMQBindingURL(origReplyToString);
                AMQShortString routingKey = burl.getRoutingKey();
                if(routingKey != null)
                {
                    replyTo.setRoutingKey(routingKey.asString());
                }

                AMQShortString exchangeName = burl.getExchangeName();
                if(exchangeName != null)
                {
                    replyTo.setExchange(exchangeName.asString());
                }
            }
            catch (URISyntaxException e)
            {
                replyTo.setRoutingKey(origReplyToString);
            }
            messageProps.setReplyTo(replyTo);

        }
View Full Code Here

        return correlationIDAsBytes == null ? null : new String(correlationIDAsBytes);
    }

    public Destination getJMSReplyTo()
    {
        ReplyTo replyTo = _messageProps.getReplyTo();

        if (replyTo == null)
        {
            return null;
        }
        else
        {
            Destination dest = null;
            SoftReference<Destination> ref = _destinationCache.get(replyTo);
            if (ref != null)
            {
              dest = ref.get();
            }
            if (dest == null)
            {
                String exchange = replyTo.getExchange();
                String routingKey = replyTo.getRoutingKey();

                dest = generateDestination(new AMQShortString(exchange), new AMQShortString(routingKey));
                _destinationCache.put(replyTo, new SoftReference<Destination>(dest));
            }
View Full Code Here

               e.setLinkedException(ex);
               throw e;
           }
        }
       
        final ReplyTo replyTo = new ReplyTo(amqd.getExchangeName().toString(), amqd.getRoutingKey().toString());
        _destinationCache.put(replyTo, new SoftReference<Destination>(destination));
        _messageProps.setReplyTo(replyTo);

    }
View Full Code Here

            messageProps.setCorrelationId(origHeader.getCorrelationId().getBytes());
        }
        final String origReplyTo = origHeader.getReplyTo();
        if(origReplyTo != null && !origReplyTo.equals(""))
        {
            ReplyTo replyTo;
            if(origReplyTo.startsWith("/"))
            {
                replyTo = new ReplyTo("",origReplyTo);
            }
            else if(origReplyTo.contains("/"))
            {
                String[] parts = origReplyTo.split("/",2);
                replyTo = new ReplyTo(parts[0],parts[1]);
            }
            else if(vhost.getExchange(origReplyTo) != null)
            {
                replyTo = new ReplyTo(origReplyTo,"");
            }
            else
            {
                replyTo = new ReplyTo("",origReplyTo);
            }
            messageProps.setReplyTo(replyTo);
        }

        messageProps.setApplicationHeaders((Map<String, Object>) MessageConverter_from_1_0.convertValue(serverMsg.getMessageHeader()
View Full Code Here

        }

        if(properties.getReplyTo() != null && properties.getReplyTo().length() != 0)
        {
            String origReplyToString = properties.getReplyTo().asString();
            ReplyTo replyTo = new ReplyTo();
            // if the string looks like a binding URL, then attempt to parse it...
            try
            {
                AMQBindingURL burl = new AMQBindingURL(origReplyToString);
                AMQShortString routingKey = burl.getRoutingKey();
                if(routingKey != null)
                {
                    replyTo.setRoutingKey(routingKey.asString());
                }

                AMQShortString exchangeName = burl.getExchangeName();
                if(exchangeName != null)
                {
                    replyTo.setExchange(exchangeName.asString());
                }
            }
            catch (URISyntaxException e)
            {
                replyTo.setRoutingKey(origReplyToString);
            }
            messageProps.setReplyTo(replyTo);

        }
View Full Code Here

            {
                props.setMessageId("ID:" + messageProps.getMessageId().toString());
            }
            if(messageProps.hasReplyTo())
            {
                ReplyTo replyTo = messageProps.getReplyTo();
                String exchangeName = replyTo.getExchange();
                String routingKey = replyTo.getRoutingKey();
                if(exchangeName == null)
                {
                    exchangeName = "";
                }
View Full Code Here

        return correlationIDAsBytes == null ? null : new String(correlationIDAsBytes);
    }

    public Destination getJMSReplyTo()
    {
        ReplyTo replyTo = _messageProps.getReplyTo();

        if ((replyTo == null) || ((replyTo.getExchange() == null) && (replyTo.getRoutingKey() == null)))
        {
            return null;
        }
        else
        {
            Destination dest = _destinationCache.get(replyTo);

            if (dest == null)
            {
                String exchange = replyTo.getExchange();
                String routingKey = replyTo.getRoutingKey();

                if (AMQDestination.getDefaultDestSyntax() == AMQDestination.DestSyntax.BURL)
                {
                    dest = generateDestination(new AMQShortString(exchange), new AMQShortString(routingKey));
                }
View Full Code Here

               jmse.setLinkedException(e);
               throw jmse;
           }
        }

        final ReplyTo replyTo = new ReplyTo(amqd.getExchangeName().toString(), amqd.getRoutingKey().toString());
        _destinationCache.put(replyTo, destination);
        _messageProps.setReplyTo(replyTo);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.transport.ReplyTo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.