You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangshenghang (via GitHub)" <gi...@apache.org> on 2026/07/27 14:17:42 UTC

[PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

zhangshenghang opened a new pull request, #11576:
URL: https://github.com/apache/seatunnel/pull/11576

   ## Purpose
   
   Fixes #9923.
   
   This PR preserves the existing `url` option, accepts `uri` as its backward-compatible alias, and adds `ssl` and `passive` options. `ssl = true` enables TLS for host-and-port connections. `passive = true` verifies an existing queue instead of declaring it, so consumer accounts without declaration permission can connect safely.
   
   ## Compatibility
   
   Existing configurations keep their current behavior: active queue declaration and plaintext host-and-port connections remain the defaults. AMQPS URIs continue to work through `url`.
   
   ## Tests
   
   - Added unit coverage for the `uri`, `ssl`, and `passive` configuration values.
   - Added unit coverage for passive and active queue declaration behavior.
   - `JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -pl seatunnel-connectors-v2/connector-rabbitmq spotless:apply`
   - `JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -q -pl seatunnel-connectors-v2/connector-rabbitmq test -Dtest=RabbitmqFactoryTest,RabbitmqClientTest`
   - `JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -q -DskipTests verify`
   
   The full `./mvnw -q test` suite is blocked before this connector by the shared `seatunnel-config-shade` module missing shaded Typesafe Config classes.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576#issuecomment-5116989248

   Quick follow-up on the gate state: the `Build` check is no longer just in progress; it is failing now.
   
   I checked the current failed run, and the failing signal is in the RabbitMQ module itself: `Run / unit-test (11, ubuntu-latest)` fails at `SeaTunnel : Connectors V2 : Rabbitmq` with the Maven Surefire failure for `connector-rabbitmq`. Since this is the same connector touched by this PR, I would treat this as the next thing to investigate on this branch rather than assuming it is only an upstream issue.
   
   Could you please check the Surefire report for `seatunnel-connectors-v2/connector-rabbitmq` from that failed run and either fix the failing test or rerun it if the report shows a clear transient failure? The check I used as the reference is:
   https://github.com/zhangshenghang/seatunnel/actions/runs/30274350161/job/90007231396
   
   From the source review side, I still do not see a new code-side blocker beyond this CI gate. Thanks again for pushing this RabbitMQ improvement forward.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576#issuecomment-5391457548

   Good question -- default JVM trust store is fine for this PR. The immediate problem is `factory.useSslProtocol()` called with no arguments, which installs RabbitMQ's `TrustEverythingTrustManager` and disables certificate validation entirely -- that is the actual vulnerability (any TLS listener, valid or not, is accepted). Switching to a proper `SSLContext` (e.g. `SSLContext.getDefault()`, or an explicit `TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm())` initialized with a null KeyStore) plus `enableHostnameVerification()` closes that gap using the JVM's already-configured CA trust store, which is what most users already rely on for other TLS-capable connectors in this repo.
   
   I'd defer configurable custom truststore/keystore options to a follow-up rather than growing this PR's scope -- `connector-elasticsearch`/`connector-easysearch` already have a precedent for that kind of dedicated `SSLUtils` if a future RabbitMQ user needs a private CA, but nothing here needs it to fix the actual bug. Minimal surface for this PR, please.
   
   Thanks for taking Issue 3 as well -- agreed a `serialVersionUID` matters here specifically because `RabbitmqConfig` rides along in Zeta's execution plan and checkpoint state, so an implicit UID recalculated across a class-shape change would throw `InvalidClassException` on restore after an upgrade. Go ahead and bundle everything into one push as planned; I'll do a full re-review once it's up.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576#issuecomment-5658379859

   Status-update check-in on the new commit since my last review.
   
   **What changed**: the only new commit (`04e29b25f4`) is `Merge remote-tracking branch 'upstream/dev' into pr-11576`. I want to flag one thing up front: this is *not* a trivially empty merge like a typical dev-sync — `dev` picked up `#12244` ("Add protobuf format support for RabbitMQ") since my last review, which touches several of the same files this PR owns (`RabbitmqConfig`, `RabbitmqBaseOptions`, `RabbitmqSinkWriter`, `RabbitmqSourceReader`, `RabbitmqSource`, plus new `RabbitmqMessageFormat`/`RabbitmqTableConfigsValidator` files and both docs pages), so I did a proper diff between the pre-merge tip (`08aee2b140`, my last "Ready to merge" head from Sept 10) and this merge commit rather than treating it as a no-op:
   
   - `RabbitmqClient.java` — the file carrying this PR's actual fix (TLS hardening via `configureSsl()`, `useSslProtocol(SSLContext.getDefault())` + `enableHostnameVerification()`, and the fail-fast `queueDeclarePassive` error handling) — has **zero diff** between the two commits. Confirmed untouched, nothing dropped.
   - `RabbitmqConfig.java` — I re-checked directly on the merge-commit head: `serialVersionUID = -6715216959598971323L`, the `ssl` field, and the `hasUrl`/`hasUri` mutual-exclusion check (`ILLEGAL_CONFIG` on both-present) are all still present and unchanged. The merge only *adds* three new fields (`format`, `protobufSchema`, `protobufMessageName`) from `#12244`, cleanly appended after this PR's `passive` field — no overlap, no reordering that would affect the `Serializable` layout in a way that matters (the explicit UID this PR added is exactly what protects against that).
   - `RabbitmqSinkWriter.java` — spot-checked the merge result: `#12244`'s protobuf serializer is wired in behind a `format` switch that defaults to `JSON` when unset, so this PR's plain JSON path (and therefore every existing job) is unaffected; nothing from this PR's writer logic was altered.
   - Docs merge (`docs/{en,zh}/connectors/{sink,source}/Rabbitmq.md`, `incompatible-changes.md`) similarly just interleaves `#12244`'s new protobuf option rows with this PR's `ssl`/`passive`/`uri` rows and TLS-compatibility note — both sets of content are present on the merged head.
   
   No source-level blockers remain open from my side; both blockers from my Sept 1 review (missing `serialVersionUID`, undocumented TLS compatibility change) were closed on `08aee2b140` and I've now re-confirmed they survived this merge intact.
   
   **CI status**: `Build` is currently **failing** on this head (`04e29b25f4`), so — same as I just found on a sibling PR going through the identical dev-sync — I checked the actual failing jobs rather than reporting "still red" at face value:
   - `unit-test (8, windows-latest)`: fails in `org.apache.seatunnel.edge.agent.connector.file.FileCollectReaderBehaviorTest.rediscoversFileAfterInactiveCursorClosed` — unrelated `seatunnel-edge-agent` module, not touched by this diff.
   - `unit-test (11, ubuntu-latest)`: fails in `org.apache.seatunnel.engine.server.TaskExecutionServiceTest.testStaleTaskDoneCleansOnlyOwnedGenerationResources` (a Mockito `WantedButNotInvoked` on `scheduledFuture.cancel(false)`) — this is in `seatunnel-engine-server`, a module this RabbitMQ-only PR never touches. I don't have enough signal here to call this "known-flaky" the way I can for the Windows edge-agent test, but the module boundary alone makes it clear it isn't caused by anything in this diff.
   
   Neither failure has anything to do with the RabbitMQ connector, and I wouldn't recommend touching connector code to address them. From a source-review perspective this remains **ready to merge**; the path forward is a job-level rerun rather than any change to this branch. As before, I only have comment-only access here, so a write-capable maintainer still needs to give the binding approval and merge once CI is green.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576#issuecomment-5385687802

   Thanks @SEZ9 for the deep follow-up on the current head (`2418b576474e`) — appreciate you tracing the exact `useSslProtocol()` / `setUri()` behavior against the pinned `amqp-client` version.
   
   Issue 1 (the no-arg `useSslProtocol()` installing a trust-all TrustManager with no hostname verification) is the same blocker I flagged on 2026-08-06, and it is still open on this head, so my CHANGES_REQUESTED stands unchanged — this needs a verifying `SSLContext` plus `enableHostnameVerification()` before merge, since shipping an `ssl` option that silently doesn't verify certificates is worse than not offering one.
   
   The serialVersionUID point on `RabbitmqConfig` (Issue 3) is also worth taking seriously: this config is part of the source/sink object graph that gets Java-serialized into Zeta's stored execution plan and checkpoint state, so an explicit `serialVersionUID` would avoid an `InvalidClassException` on restore for anyone upgrading across this change.
   
   I'll do a full re-review of the whole diff once a new commit addressing these lands.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576#issuecomment-5129180935

   Thanks @SEZ9 for the fresh review. I saw the new source-level concerns on the unchanged RabbitMQ head, so this is no longer just a CI-only gate from Daniel's queue perspective.
   
   Please address the latest code review items first; after an updated commit is pushed, I am happy to re-review the full diff together with the RabbitMQ CI result.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Connector-V2] Support secure passive RabbitMQ connections [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11576:
URL: https://github.com/apache/seatunnel/pull/11576#issuecomment-5390959091

   Thanks @DanielLeens — you're right on both points, and neither is fixed on the current head (`2418b576474e`).
   
   **Issue 1 (trust-all `useSslProtocol()`):** Agreed this is a merge blocker. I'll switch to a verifying `SSLContext` and call `enableHostnameVerification()` whenever `ssl = true`. One question before I push: is relying on the default JVM trust store acceptable for this PR, or would you like configurable truststore options included now? I'd prefer to keep the surface minimal and defer custom truststore config, but I'll follow your call.
   
   **Issue 3 (serialVersionUID on `RabbitmqConfig`):** Accepted. Since the config is Java-serialized into Zeta's execution plan and checkpoint state, I'll add an explicit `serialVersionUID` in the same commit to avoid `InvalidClassException` on restore across an upgrade.
   
   I'll also address the remaining earlier findings (the `queueDeclarePassive` error handling, the `uri` alias convention, the boolean field consistency and `declareQueue` visibility annotation, and the doc heading/example gaps) in the same push rather than trickling commits, then ping you here for the full re-review. The trust-store question above is the only thing blocking me from pushing.
   
   <!-- streview-comment:508 -->


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org