I know that I can use JMS and ActiveMQ, but I really need something very simple and without a lot of overhead. I did some test with ActiveMQ and didn't really liked a performance of persistence queues.
What I'm looking for is basic implementation of any blocking queue with ability to store message on HDD (ideally) if some size limit is reached. Then it should be able to read stored message from HDD and if possible stop writing new to HDD (restore in memory use).
My scenario is very simple - messages (json) are coming from outside world. I do some processing and then send them to another REST service. Problem can occur when target REST service is down or network between us is bad. In this case ready to go events are stored in queue that can potentially fill up all available memory. I don't want/need to write every message to HDD/DB - only those that can't fit into memory.
Thank you!