Page Edited :
qpid :
Java Broker Design - Flow to Disk
Java Broker Design - Flow to Disk has been edited by Martin Ritchie (Jan 26, 2009). Change summary: Initial Version Flow to Disk DesignOverviewCurrently, the Java Broker can do one of two things with a message it has to deliver:
This means that the broker is not able to avoid OoM exceptions i.e. send enough messages to the broker, especially if your consumers are not active, and you could bring the broker down once it explodes its available heap. This page pulls together the ideas from QPID-949 Other ImplementationsActive MQ use the idea of a message cursor and have a number of different policies for performing 'Message Spooling' : Message Cursors Current FunctionalityCurrently the broker treats persistent and transient messages differently. Persistent messages are written to disk as they are received and handles created as WeakReferenceMessageHandles. This means that when an Out of Memory(OoM) condition occurs then all the persistent message handles are GC'd. Performance hits the floor as all messages at the front of the queues must be read from disk whilst new messages are kept in memory but at the back of the queue. Transient messages are created as InMemoryMessageHandles and so cannot be purged from memory. When an OoM condition occurs the broker cannot recover. DesignThere are areas of the broker that are in need of improvement that could be affected by this implementation:
The introduction of flow to disk is a large task and potentially has many risk for the existing code base. To minimise any impact the implementation can be spread over two initial phases: Phase 1This phase introduces flow to disk for transient messages as there is no mechanism currently for clearing transient messages from memory in an OoM condition. This phase looks most like the ActiveMQ section here
At this stage we should now have the broker in a state where persistent messages can be purged and retrieved from the current store(TransactionLog)and the transient messages can now be flowed via the new MessageStore interface. This should mean that OoM problems should only now occur when we have filled the memory up with references to messages. Which then leaves us with the harder problem of paging the queue content to disk. Phase 2Once we have an operational flow to disk mechanism for all message types we can begin consolidating the code base.
Future Phases
|
Unsubscribe or edit your notifications preferences