1. Introduction to ActiveMQ Persistent and Non-Persistent Delivery

In this short tutorial, we'll discuss the difference between persistent and non-persistent message delivery with Apache ActiveMQ. Apache Artemis ActiveMQ is one of the most popular open-source messaging servers. It supports both persistent and non-persistent message delivery. By the JMS specification, the default message delivery mode is persistent. It can also be specified on a per-message basis.

2. Differences between ActiveMQ Persistent and Non-Persistent Delivery

What does dist persistent and non-persistent actually mean and what's the difference? The main difference is that if you are using persistent delivery, messages are persisted to disk or database so that they will live after the broker restarts. When using non-persistent message delivery, if broker goes down, we will lose all messages that were in transit.

Currently, Artemis ActiveMQ has two ways to persist messages - first is file journal which is highly performant and optimized for the messaging, and second is the JDBC Store, which uses JDBC to connect to a database of our choice. As stated on Artemis official documentation, the JDBC Store is still under development. In this phase is possible to use its journal features, what's not available are paging and large messages.

One more difference that is important to mention is that persistent messaging is usually slower than the one without persistence.