activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin Park <e...@cornell.edu>
Subject ajax channel:// == topic?
Date Thu, 03 Aug 2006 23:25:45 GMT

Hi,

I've been looking at the AJAX support in ActiveMQ, and I'm confused about
what the channel:// URL syntax is supposed to indicate. Is channel:// meant
to indicate a P2P queue connection? If so, I'm curious why channel:// is
used instead of queue://?

I also took a look at the code for MessageListenerServlet and
MessageServletSupport, which it extends. This added to the confusion because
the code that resolves the destination URL in
MessageServletSupport.getDestination(client, request, destination) looks
like this:

    protected Destination getDestination(WebClient client,
HttpServletRequest request, String destinationName) throws JMSException {

        // TODO cache destinations ???
        
        boolean is_topic=defaultTopicFlag;
        if (destinationName.startsWith("topic://"))
        {
            is_topic=true;
            destinationName=destinationName.substring(8);
        }
        else if (destinationName.startsWith("channel://"))
        {
            is_topic=true;
            destinationName=destinationName.substring(10);
        }
        else 
            is_topic=isTopic(request);
        
        if( destinationOptions!=null ) {
            destinationName += "?" + destinationOptions;
        }
        
        if (is_topic) {
            return client.getSession().createTopic(destinationName);
        }
        else {
            return client.getSession().createQueue(destinationName);
        }
    }

Note that the topic:// and channel:// blocks both set is_topic=true, so
effectively those two blocks do exactly the same thing. I'm guessing that
this is a bug and that channel:// means queue and should set is_topic=false.
Can someone verify?

Thanks,
Ed

-- 
View this message in context: http://www.nabble.com/ajax-channel%3A---%3D%3D-topic--tf2048550.html#a5642398
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message