In that case possibly an sqlite backed queue would be better so that it is not all in memory at once. The current implementation clones the complete message and puts it in the queue, which is a simple javascript array. Since you know you only need the payload and topic (possibly not even topic) someone who knows about sqlite and knows a bit of javascript should have no problem modifying the code to use a database backed queue instead.