Announcement Announcement Module
No announcement yet.
Principle Question when using JMS (in Spring) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Principle Question when using JMS (in Spring)

    (the content of this post has changed, because the old problem is obsolete)


    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!!!

    ps.: I love Spring! Much better than any other framework I worked until now...
    Last edited by ConstantChange; Aug 2nd, 2007, 08:36 AM. Reason: Original question is now obsolete, but related to this

  • #2

    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


    • #3