LIBRARIES-1638 - Add x-queue-type support and drop lazy support (now unsupported by rabbit)#19
LIBRARIES-1638 - Add x-queue-type support and drop lazy support (now unsupported by rabbit)#19fegbers wants to merge 18 commits into
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR updates queue declaration behavior to support the x-queue-type argument and removes the previous “lazy queue mode” usage, aligning tests and example configurations accordingly. It also bumps the project version to 3.0.0-RC1 and updates a test dependency.
Changes:
- Add
x-queue-typehandling to queue/DLX queue creation and update tests to assert the new argument. - Update test application property sets to use
arguments[x-queue-type]and removex-queue-mode/queue-modeusage. - Bump project version to
3.0.0-RC1and updatespringtainer-rabbitmqversion.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/avides/spring/rabbit/configuration/creator/QueueCreator.java | Adds x-queue-type constants and injects a default queue type into queue arguments. |
| src/main/java/com/avides/spring/rabbit/configuration/creator/DlxQueueCreator.java | Replaces x-queue-mode=lazy with x-queue-type resolution for DLX queues. |
| src/test/resources/application-queueManagementWithOneConnectionFactory.properties | Removes lazy config and adds arguments[x-queue-type]=classic for queue one. |
| src/test/resources/application-multipleConnectionFactories.properties | Fixes routing key index and adds arguments[x-queue-type]=classic; removes lazy arg. |
| src/test/java/com/avides/spring/rabbit/configuration/SpringRabbitAutoConfigurationForQueueManagementWithOneConnectionFactoryIT.java | Updates assertions for x-queue-type and argument counts. |
| src/test/java/com/avides/spring/rabbit/configuration/SpringRabbitAutoConfigurationForMultipleConnectionFactoriesIT.java | Updates assertions for x-queue-type and removes lazy expectations. |
| src/test/java/com/avides/spring/rabbit/configuration/creator/QueueCreatorTest.java | Updates expected argument map and adds an override test for queue type. |
| src/test/java/com/avides/spring/rabbit/configuration/creator/DlxQueueCreatorTest.java | Updates expected DLX args and adds an override test for queue type. |
| README.md | Updates the documented dependency version to 3.0.0-RC1. |
| pom.xml | Bumps project version, adds a developer entry, and updates springtainer-rabbitmq version. |
Comments suppressed due to low confidence (1)
src/main/java/com/avides/spring/rabbit/configuration/creator/QueueCreator.java:53
- Defaulting x-queue-type to "quorum" for all queues can produce invalid declarations when users configure non-quorum-compatible flags (e.g., durable=false or exclusive=true). RabbitMQ rejects quorum queues that are non-durable and/or exclusive, so this can turn previously-valid configurations into runtime failures unless users explicitly set x-queue-type=classic.
private Map<String, Object> createArguments()
{
Map<String, Object> arguments = new HashMap<>(queueProperties.getArguments());
arguments.putIfAbsent(X_QUEUE_TYPE, DEFAULT_X_QUEUE_TYPE);
arguments.put("x-dead-letter-exchange", "");
arguments.put("x-dead-letter-routing-key", queueProperties.getName() + ".dlx");
arguments.put("x-max-length", Long.valueOf(queueProperties.getLimit()));
return arguments;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private String resolveQueueType() | ||
| { | ||
| if (queueProperties.getArguments() != null && queueProperties.getArguments().get(X_QUEUE_TYPE) != null) | ||
| { | ||
| return (String) queueProperties.getArguments().get(X_QUEUE_TYPE); | ||
| } | ||
| return DEFAULT_X_QUEUE_TYPE; | ||
| } |
There was a problem hiding this comment.
It has to fail quickly, and we don't want to implement the “Rabbit” logic twice.
| Map<String, Object> arguments = new HashMap<>(queueProperties.getArguments()); | ||
| arguments.putIfAbsent(X_QUEUE_TYPE, DEFAULT_X_QUEUE_TYPE); | ||
| arguments.put("x-dead-letter-exchange", ""); | ||
| arguments.put("x-dead-letter-routing-key", queueProperties.getName() + ".dlx"); | ||
| arguments.put("x-max-length", Long.valueOf(queueProperties.getLimit())); |
There was a problem hiding this comment.
It has to fail quickly, and we don't want to implement the “Rabbit” logic twice.
| private String resolveQueueType() | ||
| { | ||
| if (queueProperties.getArguments() != null && queueProperties.getArguments().get(X_QUEUE_TYPE) != null) | ||
| { | ||
| return (String) queueProperties.getArguments().get(X_QUEUE_TYPE); | ||
| } | ||
| return DEFAULT_X_QUEUE_TYPE; | ||
| } |
There was a problem hiding this comment.
It has to fail quickly, and we don't want to implement the “Rabbit” logic twice.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| Map<String, Object> arguments = new HashMap<>(queueProperties.getArguments()); | ||
| arguments.putIfAbsent(X_QUEUE_TYPE, DEFAULT_X_QUEUE_TYPE); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/workflows/release.yml:9
- The release workflow is configured to run only on pushes to the feature branch
LIBRARIES-1638, while the inline comment says it should run on themasterbranch. As written, releases won’t trigger frommaster(and could trigger unexpectedly from that feature branch).
on:
push:
branches:
# Runs only on push to the master branch
- master
| private Map<String, Object> createArguments() | ||
| { | ||
| Map<String, Object> arguments = queueProperties.getArguments(); | ||
| Map<String, Object> arguments = new HashMap<>(queueProperties.getArguments()); |
| java-version: ${{ steps.determine_java_version.outputs.detected_java_version }} | ||
| server-id: central | ||
| server-username: OS_CENTRAL_USERNAME | ||
| server-password: OS_CENTRAL_PASSWORD |
| # Check if reminder comment is already given | ||
| - name: find-reminder-comment | ||
| uses: peter-evans/find-comment@v4 | ||
| id: find_reminder_comment | ||
| with: | ||
| issue-number: ${{ github.event.number }} | ||
| body-includes: "Confluence/GitHub documentation added or updated?" | ||
|
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| # Get the current project version from pom.xml | ||
| - name: get-project-version | ||
| id: get_project_version | ||
| uses: avides/actions-project-version-check@v2 |
| # Get the current project version from pom.xml | ||
| - name: get-project-version | ||
| id: get_project_version | ||
| uses: avides/actions-project-version-check@v2 |
| continue-on-error: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }} | ||
| uses: softprops/action-gh-release@v2 |
| # Verify project version is updated | ||
| - name: project-version-check | ||
| uses: avides/actions-project-version-check@v1 | ||
| uses: avides/actions-project-version-check@v2 |
|
|
||
| # Check if reminder comment is already given | ||
| - name: find-reminder-comment | ||
| uses: peter-evans/find-comment@v4 |
| -Dsonar.login=${SONAR_TOKEN} \ | ||
| mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar \ | ||
| -Dsonar.host.url=${{ secrets.OS_SONAR_HOST_URL }} \ | ||
| -Dsonar.token=${{ secrets.OS_SONAR_TOKEN }} \ |
| -Dsonar.host.url=${SONAR_HOST} \ | ||
| -Dsonar.login=${SONAR_TOKEN} \ | ||
| mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar \ | ||
| -Dsonar.host.url=${{ secrets.OS_SONAR_HOST_URL }} \ |
| -Dsonar.login=${SONAR_TOKEN} \ | ||
| mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar \ | ||
| -Dsonar.host.url=${{ secrets.OS_SONAR_HOST_URL }} \ | ||
| -Dsonar.token=${{ secrets.OS_SONAR_TOKEN }} \ |
| -Dsonar.projectKey=${GITHUB_REPOSITORY//\//_} \ | ||
| -Dsonar.pullrequest.key=${{ github.event.number }} \ | ||
| mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar \ | ||
| -Dsonar.host.url=${{ secrets.OS_SONAR_HOST_URL }} \ |
| -Dsonar.pullrequest.key=${{ github.event.number }} \ | ||
| mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar \ | ||
| -Dsonar.host.url=${{ secrets.OS_SONAR_HOST_URL }} \ | ||
| -Dsonar.token=${{ secrets.OS_SONAR_TOKEN }} \ |
…git into LIBRARIES-1638
|
| # Update GitHub Action configuration if necessary | ||
| - name: action-configuration-autoupdate | ||
| uses: avides/actions-action-configuration-autoupdate@v1 | ||
| uses: avides/actions-action-configuration-autoupdate@v2 |
|
|
||
| # Push updated GitHub Actions configuration if necessary | ||
| - uses: stefanzweifel/git-auto-commit-action@v4 | ||
| - uses: stefanzweifel/git-auto-commit-action@v7 |


Breaking Change: Starting with this version, the quorum queues are the new default => The queue declaration changes, so the queues must be recreated when the version number is incremented. In addition, “Lazy” support has been removed, since Rabbit is also removing it.