pmqueue is a simple persistent message queue written in Java (no dependencies).
importio.github.elimelt.pmqueue.MessageQueue;
importio.github.elimelt.pmqueue.QueueFactory;
importio.github.elimelt.pmqueue.message.Message;
try (MessageQueuequeue = QueueFactory.createQueue("path/to/queue.dat")) {
queue.offer(newMessage("Hello, World!".getBytes(), 1));
Messagemessage = queue.poll();
System.out.println(newString(message.getData()));
}offer, poll, and close throw IOException. QueueFactory also provides
createHighThroughputQueue, createDurableQueue, createLargeMessageQueue,
createLowMemoryQueue, and createDebugQueue, each taking a file path.
Requires JDK 21+.
./run_tests.sh
This downloads a JDK and test dependencies into target/ on first run, then
compiles and runs the test suite. No Maven install needed.
Alternatively, with Maven installed:
mvn test
Full docs: https://elimelt.com/pmqueue/