Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Weird behavior of messageListener();

  1. #11

    Default

    Hi Mark,
    yes and an interesting fact is, that if you take a look at my ComposeListener above you can see the second var: private Job job;. If I put the variable into the onMessage(Message message...) method, then the messages are correct. So it seems that the issue is related to the Job var. But I don't have any idea why...do you have a clue?

    Below the output mit local var in the method:

    Code:
    {"id":"af646cfc-c879-4757-a6dc-ddf6f18230a8","command":"COMPOSE","parentId":"3c9ace8c-3fdf-4e11-bf1c-00dc02dcc364","parentEntity":"CONFIGURATION","startDate":null,"endDate":null,"status":0,"statusMessage":null,"user":null,"parent":null}
    {"id":"bd8cc583-acbf-4075-8bdc-1fd94d2a50a3","command":"COMPOSE","parentId":"3c9ace8c-3fdf-4e11-bf1c-00dc02dcc364","parentEntity":"CONFIGURATION","startDate":null,"endDate":null,"status":0,"statusMessage":null,"user":null,"parent":null}
    {"id":"13092f44-8947-4e2a-8725-6780ae360f0f","command":"COMPOSE","parentId":"3c9ace8c-3fdf-4e11-bf1c-00dc02dcc364","parentEntity":"CONFIGURATION","startDate":null,"endDate":null,"status":0,"statusMessage":null,"user":null,"parent":null}
    
    af646cfc-c879-4757-a6dc-ddf6f18230a8 executing COMPOSE Tue Jan 10 13:53:38 CET 2012
    13092f44-8947-4e2a-8725-6780ae360f0f executing COMPOSE Tue Jan 10 13:53:38 CET 2012
    bd8cc583-acbf-4075-8bdc-1fd94d2a50a3 executing COMPOSE Tue Jan 10 13:53:38 CET 2012

  2. #12
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

    Default

    Yes, that's exactly what the problem is; since you are using an instance var there to store state passed in with each message, the code is not thread safe.

  3. #13
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    ClassCastException? The logs from the client should tell you (I think it might be DEBUG level, not sure).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •