activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michael_hk <hkprogram...@yahoo.co.jp>
Subject Re: [newbie] Confused: javax.jms.Message vs ActiveMQMessage
Date Fri, 15 Sep 2006 03:36:52 GMT

Hi Adrian,

Thanks for your clear explanation.

Michael


Adrian Co wrote:
> 
> Hi,
> 
> Usually you use the interface (Message and Destination), if you want 
> your JMS client to be JMS vendor neutral. You use ActiveMQMessage and 
> ActiveMQDestination if you want to use ActiveMQ specific functions or 
> properties. Downside is it will be harder to port to another JMS 
> provider as you are using ActiveMQ specific classes.
> 
> Another difference is you could instantiate directly ActiveMQMessage and 
> ActiveMQQueue. i.e. Queue q = new ActiveMQQueue("TEST.FOO");
> But to be vendor neutral, you should use 
> session.createQueue("TEST.FOO"),  which will return a Queue object, but 
> the actual implementation is still ActiveMQQueue.
> 
> Hope these helps.
> 
> michael_hk wrote:
>> Hi,
>>
>> I just started to learn JMS and am confused by javax.jms.Message and
>> ActiveMQMessage. I know Message is an interface and ActiveMQMessage is a
>> class implementing the Message interface. But I don't know when to use
>> which? I only saw most examples using Message.
>>
>> Similar problems for Destination vs ActiveMQDestination, Queue vs
>> ActiveMQQueue. Thanks for your time.
>>
>> Michael
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-newbie--Confused%3A-javax.jms.Message-vs-ActiveMQMessage-tf2275210.html#a6318805
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message