Skip to content

[#2271] Update Producer deliveryDelay behavior to only thrown when non-zero and always return zero - #2272

Open
mattrpav wants to merge 1 commit into
apache:mainfrom
mattrpav:amq-gh-2271
Open

[#2271] Update Producer deliveryDelay behavior to only thrown when non-zero and always return zero#2272
mattrpav wants to merge 1 commit into
apache:mainfrom
mattrpav:amq-gh-2271

Conversation

@mattrpav

@mattrpav mattrpav commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Change

This change modifies the in-progress behavior of deliveryDelay support by allowing all zero (0) values to continue to be processed. Zero (0) indicates no deliveryDelay, so the fact that this is hard-coded is no problem, as no value is going across the wire.

The UnsupportedOperationException is now thrown only when a non-zero value is specified on the setDeliveryDelay.

Driving factor

The messagehub jms pool queries the value, even when unused to retain state between instances of being borrowed and is gated around the ConnectionMetaData major and minor version. Since we changed those values, accessing of setDeliveryDelay is ungated and all Spring applications are unable to send JMS messages using ActiveMQ v6.3.0.

@cshannon cshannon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to change the setter? If it's only querying is the getter enough?

@Override
public long getDeliveryDelay() {
throw new UnsupportedOperationException("getDeliveryDelay() is not supported");
return 0L;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation looks off

@cshannon

cshannon commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Also, why don't we just roll back the version that is reporter? This fix is a mostly a workaround that shouldn't be necessary, if we just roll back the major version to 1 like it should be then that also fixes it.

@mattrpav mattrpav moved this from Backlog to In review in Apache ActiveMQ v6.4.0 Aug 3, 2026
@cshannon
cshannon requested a review from jeanouii August 3, 2026 20:25
@cshannon

cshannon commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@jeanouii - What do you think of the fix here vs rolling back the version to 1 until it's finished? You had made the change originally to ActiveMQConnectionMetaData.java in #1713 so I'm not sure if we can roll it back easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants