Let's say I send a message to a non-durable subscriber, but the subscriber fails to acknowledge the message. Will the server try to redeliver the message or do redeliveries only happen for durable subscribers? Does the outcome depend on whether the message was persistent or non-persistent?
In the book "Java Message Service" by Mark Richards I have found no clear answer but two seemingly contradictory statements:
The acknowledge() method informs the JMS provider that the message has been successfully received by the consumer. This method throws an exception to the client if a provider failure occurs during the acknowledgment process. The provider failure results in the message being retained by the JMS server for redelivery.
This would suggest that the message is redelivered.
The message may be lost if the provider fails while delivering a message to a consumer with a nondurable subscription. If a durable subscriber receives a message, and a failure occurs before the acknowledgment is returned to the provider, then the JMS provider considers the message undelivered and will attempt to redeliver it.
Alright, so the message may be lost, i.e. not redelivered, but what circumstances does this depend on?
Is there even a usecase for the combination of durable subscribers and non-persistent messages?