Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-5282 remove deprecated queue-related methods #5484

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

jbertram
Copy link
Contributor

@jbertram jbertram commented Feb 1, 2025

All but one QueueImpl constructor was deprecated years ago in 2efa44d. Since QueueImpl is an internal implementation object (as the name suggests) these constructors can be completely removed and didn't technically need to be deprecated in the first place.

Furthermore, the methods from QueueFactoryImpl which use these constructors were also deprecated in that same commit. Despite the fact that there is a QueueFactory interface these objects are still for internal use/implementation. Therefore, these deprecated methods can and should be removed.

@@ -79,9 +79,9 @@ public void setPostOffice(final PostOffice postOffice) {
public Queue createQueueWith(final QueueConfig config) {
final Queue queue;
if (lastValueKey(config) != null) {
queue = new LastValueQueue(config.id(), config.address(), config.name(), config.filter(), config.getPagingStore(), config.pageSubscription(), config.user(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isExclusive(), config.isGroupRebalance(), config.getGroupBuckets(), config.getGroupFirstKey(), config.consumersBeforeDispatch(), config.delayBeforeDispatch(), config.isPurgeOnNoConsumers(), lastValueKey(config), config.isNonDestructive(), config.isAutoDelete(), config.getAutoDeleteDelay(), config.getAutoDeleteMessageCount(), config.isConfigurationManaged(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor(), server, this);
queue = new LastValueQueue(QueueConfiguration.of(config.name()).setAddress(config.address()).setId(config.id()).setUser(config.user()).setDurable(config.isDurable()).setTemporary(config.isTemporary()).setAutoCreated(config.isAutoCreated()).setRoutingType(config.deliveryMode()).setMaxConsumers(config.maxConsumers()).setExclusive(config.isExclusive()).setGroupRebalance(config.isGroupRebalance()).setGroupBuckets(config.getGroupBuckets()).setGroupFirstKey(config.getGroupFirstKey()).setConsumersBeforeDispatch(config.consumersBeforeDispatch()).setDelayBeforeDispatch(config.delayBeforeDispatch()).setPurgeOnNoConsumers(config.isPurgeOnNoConsumers()).setLastValueKey(lastValueKey(config)).setNonDestructive(config.isNonDestructive()).setAutoDelete(config.isAutoDelete()).setAutoDeleteDelay(config.getAutoDeleteDelay()).setAutoDeleteMessageCount(config.getAutoDeleteMessageCount()).setConfigurationManaged(config.isConfigurationManaged()), config.filter(), config.getPagingStore(), config.pageSubscription(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor(), server, this);
Copy link
Member

Choose a reason for hiding this comment

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

Since almost all of the options appear to be common, I think it would be both more readable and more maintainable if a single set of options was prepared first with all the common config, and then only the difference applied to them before creating the queue objects and passing them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went back and forth on this for awhile today trying to decide if this code should be updated or just left alone. Ultimately I decided it should be removed along with the other deprecated code. I pushed a new commit with that change plus an updated commit message with an explanation. Let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

I hadn't even noticed that the QueueConfig-using factory method I was commenting on was itself also deprecated (since that doesnt show in the initial diff context of the change, and since the described aim was 'deprecated QueueImpl constructor removal', I simply didnt think to look further at the factory method since it was just being updated to use the new QueueImpl constructors).

Given the factory methods were deprecated in the same commit as the QueueImpl constructors nearly 5 years ago, and you say the factories are also still really internal/impl detail, just removing the deprecated factory methods rather than updating them seems fair.

Copy link
Member

@gemmellr gemmellr Feb 12, 2025

Choose a reason for hiding this comment

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

Though I ran the full test suite on this and saw some failures that look like theyll be related to the latest changes.

Copy link
Contributor Author

@jbertram jbertram Feb 12, 2025

Choose a reason for hiding this comment

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

Full test-suite is green on this with the latest push (fdf1b03).

@jbertram jbertram changed the title ARTEMIS-5282 remove deprecated QueueImpl ctors ARTEMIS-5282 remove deprecated queue-related methods Feb 7, 2025
@jbertram jbertram force-pushed the ARTEMIS-5282 branch 2 times, most recently from 6bf1a5d to 986c9c2 Compare February 12, 2025 18:54
All but one QueueImpl constructor was deprecated years ago in
2efa44d. Since QueueImpl is an
internal implementation object (as the name suggests) these
constructors can be completely removed and didn't technically need to
be deprecated in the first place.

Furthermore, the methods from QueueFactoryImpl which use these
constructors were also deprecated in that same commit. Despite the fact
that there is a QueueFactory interface these objects are still for
internal use/implementation. Therefore, these deprecated methods can and
should be removed.
@gemmellr gemmellr merged commit 5f83560 into apache:main Feb 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants