-
Aug 2nd, 2007, 02:54 AM
#1
Principle Question when using JMS (in Spring)
(the content of this post has changed, because the old problem is obsolete)
Hi!
I work with JMS queue/s to parallelize work. In that process i send a worker class to the queue, which is then run by the consumer, which alters some members of that worker class, then that same worker gets sent back to a response queue which calls a notification method on another object that a freshly altered worker has arrived. THe Object which is not notify is though stored in the worker, but the serialisiation of java - and thats the problem - seems to create dublicates of all objects that are members of the worker sent. So when my worker comes back and I want him to notify his "parent" it does not work anymore, because now its a different object.
Does that make sense? If so, how can I keep the original reference to the object to notify in the worker after sending it around?
Thanks a lot!!!
CC
ps.: I love Spring! Much better than any other framework I worked until now...
Last edited by ConstantChange; Aug 2nd, 2007 at 08:36 AM.
Reason: Original question is now obsolete, but related to this
I am an Object
-
Aug 2nd, 2007, 09:19 AM
#2
Hello,
while sending to queue all objects must be serialized, so it is normaly that you get two different instances fo an object. Is it a big deal to implement equals() and hashcode() inside your notification object ?
Do you use the JMS queues just for threading issues ?
If so, another possibility is to use a Queue implementation of the java.util.concurrent application, there you also have put() and take() method, and the queues works out without serialization.
best rgds
agim
-
Aug 3rd, 2007, 03:09 AM
#3
I am an Object
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules