-
1. Re: Attaching Transient properties to delivered messages
clebert.suconic May 14, 2010 4:46 PM (in response to bill.burke)If you are using core-api, you could just use regular properties.
Each message on the consumer will be a copy (on the consumer). It's just a reference on the server, but after received the messages are copies.
If you're using JMS.. I'm not sure how you would do it.. since message are read-only after received, as required per spec.
I'm attaching two tests you could verify this yourself.
-
ShowbillJMS.java.zip 1.1 KB
-
ShowBill.java.zip 1.1 KB
-
-
2. Re: Attaching Transient properties to delivered messages
timfox May 15, 2010 3:02 AM (in response to clebert.suconic)Clebert Suconic wrote:
If you are using core-api, you could just use regular properties.
Each message on the consumer will be a copy (on the consumer). It's just a reference on the server, but after received the messages are copies.
If you're using JMS.. I'm not sure how you would do it.. since message are read-only after received, as required per spec.
I'm attaching two tests you could verify this yourself.
Assuming Bill is plugging in at the server side, that won't work. The message in the ServerConsumerImpl is not a copy - there is only one per topic.
Bill will have to create his own holder class which keeps a reference to the Message and his information that he wants to cache.
Alternatively could just call copy() on the Message instance and cache that.