Status: Plan only. No code in this PR. Implementation should land in a follow-up PR after issue #5305 (architecture guard) is in place to enforce the boundary.
Move the connector SPI interfaces out of eventmesh-connector-runtime into a new eventmesh-connector-api module so plugins depend on a stable, minimal API jar and the runtime implements / orchestrates against that API.
From eventmesh-connector-runtime/src/main/java/org/apache/eventmesh/connector/:
SourceConnectorSinkConnectorEventMeshEndpointHttpCallerConnectorOffsetStoreCloudEventSerializerPollEntry (value type used by both sides)eventmesh-connector-api/
src/main/java/org/apache/eventmesh/connector/api/
SourceConnector.java
SinkConnector.java
EventMeshEndpoint.java
HttpCaller.java
ConnectorOffsetStore.java
CloudEventSerializer.java
PollEntry.java
package-info.java
build.gradle (deps: cloudevents-core only — no plugin imports, no HTTP libs)
eventmesh-connector-runtime depends on :eventmesh-connector-api and continues to provide implementations (EventMeshHttpEndpoint, RocksDBConnectorOffsetStore, RemoteOffsetStore, InMemoryOffsetStore, ConnectorRuntime, ConnectorManager, ConnectorAdminServer, ConnectorApplication, ConnectorDef).
Each plugin under eventmesh-connector-plugin/eventmesh-connector-* should depend on :eventmesh-connector-api instead of :eventmesh-connector-runtime.
For each of the 23 plugins:
build.gradle: replace implementation project(":eventmesh-connector-runtime") with implementation project(":eventmesh-connector-api").org.apache.eventmesh.connector.ConnectorRuntime (it should not — plugins only use the SPI), add implementation project(":eventmesh-connector-runtime") back. Initial audit shows no plugin currently touches runtime internals.Add a rule:
noClasses().that().resideInAPackage("..eventmesh.connector.plugin..")
.should().dependOnClassesThat().resideInAPackage("..eventmesh.connector.runtime..")
.because("plugins must depend only on the connector-api SPI, not on runtime internals")
This is the contract — once it passes, every plugin author who reaches into runtime internals will fail the architecture guard.
build.gradle swap. CI matrix must stay green; existing plugin tests are non-existent today (this PR adds them).B mode enabled — rule.check() fails the build). This is the enforcement moment. Without it the split is informational only.org.apache.eventmesh.connector.X from runtime, the import path will break. Audit by git grep "org.apache.eventmesh.connector" -- '*/src/main/' before M1.package org.apache.eventmesh.connector; (no .api) means a lot of plugin code will see its package-info.java change. Acceptable — it's API contract clarification.build.gradle edits are mechanical but the Gradle dependency graph will shift; expect one or two of the ~30 modules to need a transitive adjustment.eventmesh-connector-api jar builds standalone (deps: cloudevents-core only).eventmesh-connector-runtime depends on :eventmesh-connector-api.:eventmesh-connector-api, not on :eventmesh-connector-runtime.:eventmesh-architecture-guard:test passes.Should PollEntry and CloudEventSerializer stay in the SPI jar, or split into a connector-api-types sub-jar? Recommendation: keep them together in this PR; revisit if a second downstream consumer (e.g. a webhook sink SDK) materialises.