oscerd opened a new pull request, #22970: URL: https://github.com/apache/camel/pull/22970
## Backport of #22945 Cherry-pick of #22945 onto `camel-4.14.x`. **Original PR:** #22945 — CAMEL-23409: camel-sjms - Disable ObjectMessage by default **Original author:** @oscerd **Target branch:** `camel-4.14.x` ### Conflict resolution Same three categories as the camel-4.18.x backport (#22968): 1. `JmsBinding.java` — main uses pattern matching `instanceof ObjectMessage objectMessage`, 4.14.x still uses `instanceof ObjectMessage` plus an explicit cast. Kept the 4.14.x style and inserted the new `objectMessageEnabled` guard before the existing extraction logic. 2. `camel-4x-upgrade-guide-4_21.adoc` — does not exist on `camel-4.14.x`. Moved the new `camel-sjms / camel-sjms2` section into `camel-4x-upgrade-guide-4_14.adoc` under `Upgrading from 4.14.7 to 4.14.8`, right after the existing `camel-jms` entry, mirroring the 4.18.x convention. 3. `@Metadata` / `@UriParam` `security` attribute — not supported on the annotation interfaces in 4.14.x (the `security` attribute is a 4.21+ catalog feature). Dropped `security = "insecure:serialization"` from both `SjmsComponent.objectMessageEnabled` and `SjmsEndpoint.objectMessageEnabled`. Generated catalog files were regenerated accordingly. 4. Generated json catalogs (sjms.json, sjms2.json at module and root catalog levels) — took the cherry-pick's version then let the build regenerate them. ### Original description For consistency with camel-jms (CAMEL-23373, already on 4.14.x via #22920), disable creation and reading of `jakarta.jms.ObjectMessage` by default in camel-sjms and add a new `objectMessageEnabled` option (default `false`) on `SjmsComponent` and `SjmsEndpoint` to opt back in. camel-sjms2 inherits the change via `Sjms2Endpoint extends SjmsEndpoint` and `Sjms2Component extends SjmsComponent`. When disabled, `JmsBinding` refuses to: - create an `ObjectMessage` from a Serializable body (auto-detected `jmsMessageType=Object` or explicitly set) - create an `ObjectMessage` for `transferException` - extract the body of a received `ObjectMessage` Tests: `SjmsObjectMessageEnabledTest` covers producer/consumer default-disabled behavior, endpoint-level override, and component-level override; `JmsBindingObjectMessageEnabledTest` covers the `transferException` reply path. ### Companion changes Per the new project convention (a follow-up to #22969), the corresponding `=== camel-sjms / camel-sjms2` entry will also be added to `camel-4x-upgrade-guide-4_14.adoc` on `main` once both this PR and #22968 (the camel-4.18.x backport) are merged. ### Test plan - [x] `mvn test` in `components/camel-sjms` on `camel-4.14.x`: 118 tests, 0 failures, 5 skipped (same as on main). - [x] `mvn -DskipTests install` in `components/camel-sjms2`: clean. - [x] Full root build (`mvn clean install -DskipTests -Dquickly`): clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
