• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

out of sync problem?

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have constructed a queue, to put incoming operations to be computed. So, when operation comes via onMessage method, it is put at end of ConcurrentLinkedQueue (was LinkedList earlier, but also was not working). After adding, I start (just once, after deploy) processing thread, which in interval is checking the list for operations to process. The problem is, that once per 2-3 days something goes wrong. I noticed, that operations are added correctly to the queue, however processing thread, sees the queue empty all the time. From the logs, there is no error. Could it be my queue is out of sync?


Here's the code


 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thing puzzling me is : what is that queue doing in a message-driven bean ?
 
Michal Glowacki
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The processing is very complex and I don't want situation when two or more operations are processed the same time. That's why I put a queue there and a thread for processing one by one. I used MDB so the operations are processed asynchronously, so my web app does not have to wait for the result.
 
reply
    Bookmark Topic Watch Topic
  • New Topic