qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject JMS List support - oh dear! again.....
Date Fri, 08 Feb 2013 09:31:37 GMT
Hi Guys,
I was planning on having a look at the org.apache.qpid.jms.ListMessage 
stuff and move away from the cast to MapMessage, but a somewhat irksome 
thought struck me before I got started.

As the moment my QMF2 code can compile against more or less any version 
of the Qpid Java client runtime. I needed to include a specific target 
to build a patched AMQPMessageDelegate_0_10.java for versions below 0.10 
but everything else should currently just compile.


I'm guessing that org.apache.qpid.jms.ListMessage was added in 0.20, so 
if I actually use it compilation will break for everything else :-(

I'm not wildly keen on the MapMessage approach as you know, both for 
"philosophical reasons :-)" and because I can't get the size() so I need 
to "make up" a size for the ArrayList that I copy the elements from the 
MapMessage into. The asList() method on ListMessage looked to be the 
nicest option from the recent threads.


So I'm thinking that I'm going to either:
a) Have to stick with MapMessage 'cause I know that compiles across the 
board, but it offends me rather.
b) have a specific target for 0.20 onwards, which I don't especially 
like either.
c) Use reflection to find the asList(), which should be do-able and has 
a certain entertainment value, but I suspect will probably be less 
efficient than just living with the MapMessage inefficiencies - I can't 
say for sure, any thoughts on that?


Does anybody have any better suggestions than those that'll allow me to 
use lists across different Qpid releases without needing different builds?


Did I mention I preferred ObjectMessage :-) so this'll be another reason 
why I do :-D

Cheers,
Frase


On 29/01/13 20:18, Rajith Attapattu wrote:
> You can cast it to the said interface.
> List message interface has a method called asList() to retrieve a
> java.util.List or you can use methods like get(int index)
>
> If you use -Dqpid.use_legacy_stream_message=false, then the sender
> could work with the standard stream message interface and it will get
> sent on the wire as a List Message.
> On the receiver side, you could use the stream message methods as well.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message