public static string GetDestinationAddress()

in src/NMS.AMQP/Util/AmqpDestinationHelper.cs [28:67]


        public static string GetDestinationAddress(IDestination destination, IAmqpConnection connection)
        {
            if (destination != null)
            {
                string qPrefix = null;
                string tPrefix = null;
                if (!destination.IsTemporary)
                {
                    qPrefix = connection.QueuePrefix;
                    tPrefix = connection.TopicPrefix;
                }

                string destinationName = null;
                string prefix = null;
                if (destination.IsQueue)
                {
                    destinationName = (destination as IQueue)?.QueueName;
                    prefix = qPrefix ?? string.Empty;
                }
                else
                {
                    destinationName = (destination as ITopic)?.TopicName;
                    prefix = tPrefix ?? string.Empty;
                }

                if (destinationName != null)
                {
                    if (!destinationName.StartsWith(prefix))
                    {
                        destinationName = prefix + destinationName;
                    }
                }

                return destinationName;
            }
            else
            {
                return null;
            }
        }