}
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);
}