Skip to content

GH-2452: Redeclare manual entities automatically #2453

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

Merged
merged 1 commit into from
May 1, 2023

Conversation

artembilan
Copy link
Member

Fixes #2452

The queue might be declared manually by an AmqpAdmin and its name simply can be used in the listener container. When we lose a connection, we would like to have just deleted manual anonymous queue to be redeclared.

  • Introduce AmqpAdmin.getManualDeclarables()
  • Check for queue name presence in the manualDeclarables as well from a AbstractMessageListenerContainer.attemptDeclarations()
  • Modify DirectMessageListenerContainerIntegrationTests.testRecoverDeletedQueueGuts() to deal with manual declaration and auto-recovery from the container

Cherry-pick to 2.4.x

Fixes spring-projects#2452

The queue might be declared manually by an `AmqpAdmin`
and its name simply can be used in the listener container.
When we lose a connection, we would like to have just deleted
manual anonymous queue to be redeclared.

* Introduce `AmqpAdmin.getManualDeclarables()`
* Check for queue name presence in the `manualDeclarables` as well
from a `AbstractMessageListenerContainer.attemptDeclarations()`
* Modify `DirectMessageListenerContainerIntegrationTests.testRecoverDeletedQueueGuts()`
to deal with manual declaration and auto-recovery from the container

**Cherry-pick to `2.4.x`**
@artembilan
Copy link
Member Author

Feel free, Gary, just apply the change into a main and that's it.
Also let me know if some doc is needed to be added as well.
Thanks

@garyrussell garyrussell merged commit ee681bd into spring-projects:main May 1, 2023
garyrussell pushed a commit that referenced this pull request May 1, 2023
Fixes #2452

The queue might be declared manually by an `AmqpAdmin`
and its name simply can be used in the listener container.
When we lose a connection, we would like to have just deleted
manual anonymous queue to be redeclared.

* Introduce `AmqpAdmin.getManualDeclarables()`
* Check for queue name presence in the `manualDeclarables` as well
from a `AbstractMessageListenerContainer.attemptDeclarations()`
* Modify `DirectMessageListenerContainerIntegrationTests.testRecoverDeletedQueueGuts()`
to deal with manual declaration and auto-recovery from the container

**Cherry-pick to `2.4.x`**
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.

setRedeclareManualDeclarations not honoured if no queue beans declared
2 participants