1 of 1 people found this helpful
I don't know of any outstanding performance or scalability issues with scheduled messages. You'll want to use HornetQ 2.4.1.Final so you get both https://issues.jboss.org/browse/HORNETQ-1278 and https://issues.jboss.org/browse/HORNETQ-1305.
It is OK to mix scheduled and unscheduled messages in the same queue as far as I know.
I took a quick look at the code from the links in the bugs you reference and it looks like there are a few more things to be potentially worried about with heavy use of scheduled messages:
- For each unique delivery time, it creates a new map entry and a new Runnable that gets scheduled to run at that time. So the memory usage would increase with each unique time.
- There's thread synchronization between the threads receiving and queuing scheduled messages and the ScheduledDeliveryHandlerImpl's runnable execution threads that are processing and adding to queues the scheduled messages whose time has come.
As you note, it does require memory to keep track of the messages' schedules. We also generally try to avoid synchronization whenever possible so there's probably a good reason it's in there (I haven't done an in-depth assessment).
In any event, if you can identify a better way to do it we always welcome contributions.
Right, I just wanted to get an understanding of what the impacts of using vs. not scheduled messages would be, which look like increased memory consumption with each unique delivery time and increased thread contention. I certainly don't have any better ideas and wasn't trying to be at all critical, I just wanted to understand the implications.