You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Edwin Park <es...@cornell.edu> on 2006/08/04 01:25:45 UTC

ajax channel:// == topic?

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.


Re: ajax channel:// == topic?

Posted by chago <na...@visualxs.com>.
So did this turn out to be a bug after all? 

I'm looking at the 4.2 SNAPSHOT and is_topic = true for channels.


Imran.Sarwar wrote:
> 
> Hi,
> 
> You are right, it seems to be a bug. The is_topic flag should be set to
> false in case of channel
> 
> Thanks,
> Imran
> 

-- 
View this message in context: http://www.nabble.com/ajax-channel%3A---%3D%3D-topic--tf2048550s2354.html#a9698852
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ajax channel:// == topic?

Posted by "Imran.Sarwar" <is...@i2cinc.com>.
Hi,

You are right, it seems to be a bug. The is_topic flag should be set to
false in case of channel

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