Java EE 7 Application Developer — Question 46

You are working with JMS publish-subscribe operations.
What happens when a producer publishes a message to a topic for which a durable subscription exists but there are no subscribers available?

Answer options

Correct answer: C

Explanation

The correct answer is C because a durable subscription ensures that messages are stored until a subscriber is available to consume them, as long as they have not timed out. Option A is incorrect because the publisher does not wait indefinitely; it will send the message regardless. Option B is wrong since the message will be stored for future consumption. Option D is incorrect because the publisher is not notified about the lack of subscribers in this context.