Results 1 to 3 of 3

Thread: Principle Question when using JMS (in Spring)

  1. #1
    Join Date
    Aug 2007
    Location
    London
    Posts
    6

    Question 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

  2. #2
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    452

    Default

    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

  3. #3
    Join Date
    Aug 2007
    Location
    London
    Posts
    6

    Thumbs up

    Thanks!

    Cheers,
    CC
    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
  •