jakartaee / jakartaee/messaging

Define lifecycle of durable subscriptions used by MDBs

Open
#74 3 comments 0 reactions 0 assignees View on GitHub
pd20-forreview-major Priority: Major Type: Improvement
Dominant language
Java
Stars
49
Forks
34
PR merge metrics
No merged PRs in 30d

Description

This issue was raised on the JMS forum:
[https://forums.oracle.com/forums/thread.jspa?threadID=2124418](https://forums.oracle.com/forums/thread.jspa?threadID=2124418)
and is being logged here on behalf of that contributor

How durable are durable topic subscriptions?

Non durable subscribers receive topic messages only if they are active at the time when the message is received and processed by the JMS engine. Durable subscribers are more complicated, they receive messages if the durable subscription is active when the message is received and processed by the JMS engine.

How do I know when messages are kept or discarded? Simply put, what is the lifecycle of the subscription?

When using synchronous receptions or message listeners, the durable subscription lifecycle is managed by the developper using Session:createDurableSubscriber and Session:unsubscribe.

When using MDB, the durable subscription lifecycle is unspecified and is application server dependant.

With JBoss 4.2, the subscription lifecyle is the same than the MDB. This means that if the application is redeployed (for example copy the new .ear over the old one in the deploy folder), there is a time frame when the subscription in non existent, so messages are lost.

WebLogic 10 also seems to associate the subscription lifecycle to the MDB. WebLogic 10 offers a flag, "durable-subscription-deletion", to allow or not the durable subscription deletion when the MDB is undeployed or removed. True means that when the application is redeployed the subscription is deleted and messages are lost. When false is used (it is the default value) the subscription remains even when the MDB is undeployed. I hope this does not mean that if we permanently undeploy the application, the subscription will stay and messages will continue to stack.

With WebSphere 6 the situation is different. The subscription is not associated to the MDB but to an activation spec that is an administred object. The MDB is merely a client of the activation spec. This way messages are kept as long as the activation spec is active, regardless of application starts/stops/redeploys/etc. Messages are not lost.

We need a portable way to use durable topics subscriptions.
#### Affected Versions
[1.1]

Contributor guide

Open the contributing guide

Research direction

Start with the JMS forum discussion linked in the issue and compare the lifecycle described for Session:createDurableSubscriber, Session:unsubscribe, MDBs, and activation specs. Determine the portable lifecycle behavior needed across application servers and define what should happen during redeployments, undeployments, and application restarts.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.