private Destination createDestination() throws Exception
{
if (config.isUseUniqueDests())
{
_logger.debug("Prefix : " + prefix);
Address addr = Address.parse(config.getAddress());
AMQDestination temp = (AMQDestination) AMQDestination.createDestination(config.getAddress());
int type = ((AMQSession_0_10)session).resolveAddressType(temp);
if ( type == AMQDestination.TOPIC_TYPE)
{
addr = new Address(addr.getName(),addr.getSubject() + "." + prefix,addr.getOptions());
System.out.println("Setting subject : " + addr);
}
else
{
addr = new Address(addr.getName() + "_" + prefix,addr.getSubject(),addr.getOptions());
System.out.println("Setting name : " + addr);
}
return AMQDestination.createDestination(addr.toString());
}
else
{
return AMQDestination.createDestination(config.getAddress());
}