Example #1
0
        public static Destination ToDestination(string text)
        {
            if (text == null)
            {
                return(null);
            }

            int    type      = Destination.STOMP_QUEUE;
            string lowertext = text.ToLower();

            if (lowertext.StartsWith("/queue/"))
            {
                text = text.Substring("/queue/".Length);
            }
            else if (lowertext.StartsWith("/topic/"))
            {
                text = text.Substring("/topic/".Length);
                type = Destination.STOMP_TOPIC;
            }
            else if (lowertext.StartsWith("/temp-topic/"))
            {
                text = text.Substring("/temp-topic/".Length);
                type = Destination.STOMP_TEMPORARY_TOPIC;
            }
            else if (lowertext.StartsWith("/temp-queue/"))
            {
                text = text.Substring("/temp-queue/".Length);
                type = Destination.STOMP_TEMPORARY_QUEUE;
            }
            else if (lowertext.StartsWith("/remote-temp-topic/"))
            {
                type = Destination.STOMP_TEMPORARY_TOPIC;
            }
            else if (lowertext.StartsWith("/remote-temp-queue/"))
            {
                type = Destination.STOMP_TEMPORARY_QUEUE;
            }

            return(Destination.CreateDestination(type, text));
        }