Skip to content

CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default#10325

Merged
davsclaus merged 5 commits intoapache:mainfrom
sdurrenmatt:CAMEL-19417
Jun 12, 2023
Merged

CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default#10325
davsclaus merged 5 commits intoapache:mainfrom
sdurrenmatt:CAMEL-19417

Conversation

@sdurrenmatt
Copy link
Contributor

Description

The goal is to support all the most important RabbitMQ message properties by default (without the need to provide a custom MessagePropertiesConverter). Those include the removed RabbitMQ component's message properties. Can simplify migration of applications from RabbitMQ to Spring RabbitMQ, which is a necessary step for migrating to Camel 4.

I had to modify how content type and timestamp were already handled. I found it better to use new Spring RabbitMQ constants rather than exchange constants. This is a more consistent approach imo. Both are optional and application-specific, like most of the other message properties.

This PR also includes a copy-paste bug fix in the method appendInputHeader.

Target

  • I checked that the commit is targeting the correct branch (note that Camel 3 uses camel-3.x, whereas Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I formatted the code using mvn -Pformat,fastinstall install && mvn -Psourcecheck

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🐫 Maintainers, please note that first-time contributors require manual approval for the GitHub Actions to run.

⚠️ Please note that the changes on this PR may be tested automatically if they change components.

🤖 Use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

If necessary Apache Camel Committers may access logs and test results in the job summaries!

Copy link
Contributor

@essobedo essobedo left a comment

Choose a reason for hiding this comment

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

Hi, thx for the PR, here are some remarks/questions

- replace exchange.getMessage() with local variable
- use labels in metadata
- use Map.of instead of ImmutableMap.Builder
- do not remove headers (header filter strategy already applies)
- use getHeader(String name, Class<T> type)
Copy link
Contributor

@essobedo essobedo left a comment

Choose a reason for hiding this comment

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

Sounds much better thx 👍

@github-actions
Copy link
Contributor

Components test results:

Total Tested Failed ❌ Passed ✅
1 1 1 0

@github-actions
Copy link
Contributor

🚫 There are (likely) no changes in core core to be tested in this PR

@github-actions
Copy link
Contributor

Components test results:

Total Tested Failed ❌ Passed ✅
1 1 0 1

@github-actions
Copy link
Contributor

🚫 There are (likely) no changes in core core to be tested in this PR

@davsclaus davsclaus merged commit eedb8c2 into apache:main Jun 12, 2023
@sdurrenmatt sdurrenmatt deleted the CAMEL-19417 branch June 13, 2023 18:16
tanaymittal25 pushed a commit to tanaymittal25/camel that referenced this pull request Oct 25, 2023
…y default (apache#10325)

* CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default

* CAMEL-19417: PR review
- replace exchange.getMessage() with local variable
- use labels in metadata
- use Map.of instead of ImmutableMap.Builder

* CAMEL-19417: PR review
- do not remove headers (header filter strategy already applies)

* CAMEL-19417: PR review
- use getHeader(String name, Class<T> type)

* CAMEL-19417: Reformat code

(cherry picked from commit eedb8c2)
tanaymittal25 pushed a commit to tanaymittal25/camel that referenced this pull request Oct 29, 2023
…y default (apache#10325)

* CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default

* CAMEL-19417: PR review
- replace exchange.getMessage() with local variable
- use labels in metadata
- use Map.of instead of ImmutableMap.Builder

* CAMEL-19417: PR review
- do not remove headers (header filter strategy already applies)

* CAMEL-19417: PR review
- use getHeader(String name, Class<T> type)

* CAMEL-19417: Reformat code

(cherry picked from commit eedb8c2)
tanaymittal25 pushed a commit to tanaymittal25/camel that referenced this pull request Nov 3, 2023
…y default (apache#10325)

* CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default

* CAMEL-19417: PR review
- replace exchange.getMessage() with local variable
- use labels in metadata
- use Map.of instead of ImmutableMap.Builder

* CAMEL-19417: PR review
- do not remove headers (header filter strategy already applies)

* CAMEL-19417: PR review
- use getHeader(String name, Class<T> type)

* CAMEL-19417: Reformat code

(cherry picked from commit eedb8c2)
davsclaus pushed a commit that referenced this pull request Nov 3, 2023
* CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default (#10325)

* CAMEL-19417: camel-spring-rabbitmq - convert all message properties by default

* CAMEL-19417: PR review
- replace exchange.getMessage() with local variable
- use labels in metadata
- use Map.of instead of ImmutableMap.Builder

* CAMEL-19417: PR review
- do not remove headers (header filter strategy already applies)

* CAMEL-19417: PR review
- use getHeader(String name, Class<T> type)

* CAMEL-19417: Reformat code

(cherry picked from commit eedb8c2)

* CAMEL-19417: Regen

(cherry picked from commit 5fee860)

* CAMEL-19961 - Auto Generated Build Files

---------

Co-authored-by: Steven Dürrenmatt <46787973+sdurrenmatt@users.noreply.github.com>
Co-authored-by: tanay.agarwal <tanay.agarwal@volantetech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants