Skip to content

feat(eventbus): add Kafka/Redpanda producer and admin auto-configuration - #200

Merged
tiana-code merged 1 commit into
mainfrom
feat/E-03-eventbus-broker-config
Jun 18, 2026
Merged

feat(eventbus): add Kafka/Redpanda producer and admin auto-configuration#200
tiana-code merged 1 commit into
mainfrom
feat/E-03-eventbus-broker-config

Conversation

@tiana-code

Copy link
Copy Markdown
Owner

What

Second slice of E-03 (Event Bus). Adds libs/fincore-eventbus, a Spring auto-configuration library that any service includes to get a broker producer and admin client. The outbox dispatcher (#190) will use these beans; this slice stops at "the producer/admin client exists, is correct, and connects".

  • One spring-kafka client serves both Redpanda (default dev/test) and Apache Kafka (prod). Redpanda speaks the Kafka protocol, so the "profile" difference is purely connection/security properties, not code.
  • EventBusProperties (@ConfigurationProperties("fincore.eventbus")): bootstrapServers (required), clientId, and a security group (protocol + optional SASL mechanism/JAAS, sourced from env).
  • EventBusAutoConfiguration: ProducerFactory/KafkaTemplate<String,String>/KafkaAdmin beans, each @ConditionalOnMissingBean so a consumer can override.
  • Durability is a fixed invariant, not a knob: acks=all + enable.idempotence=true are hardcoded so a ledger event can never be silently dropped or duplicated at the producer. Connection and security stay configurable.
  • The auto-config is @ConditionalOnProperty(fincore.eventbus.bootstrap-servers) and is on no service classpath yet, so it is inert until a service opts in (the ledger build is untouched).

Decisions (see plan.md)

  • Shared auto-config library, not a central broker service (the outbox is per-service in the modular monolith).
  • Plain spring-kafka now; Spring Cloud Stream is its own slice (F-03.7 Spring Cloud Stream integration #194).
  • Spring Boot BOM imported via Gradle native platform() rather than the io.spring.dependency-management plugin — the plugin applies the BOM to every configuration including detekt's, downgrading detekt's bundled Kotlin compiler.

Gates

Local (-x integrationTest, Docker is unavailable in WSL): :libs:fincore-eventbus:{test,detekt,detektTest,spotlessCheck,assemble,compileIntegrationTestKotlin} green. The Testcontainers-Redpanda IT (publish round-trip + admin topic) runs on CI. critic GO-WITH-CHANGES (applied), code-reviewer APPROVE (nits applied), security-auditor PASS, evaluator 0.88.

Closes #189

Introduce libs/fincore-eventbus, a Spring auto-configuration library that any
service includes to get a broker producer and admin client. One spring-kafka
client serves both Redpanda (default) and Apache Kafka (prod); the difference is
connection and security properties only. Durability is fixed (acks=all,
enable.idempotence=true) so a ledger event can never be silently dropped or
duplicated at the producer; bootstrap-servers is required and the auto-config is
inert until a service opts in. Every bean is conditional-on-missing so a consumer
can override. spring-kafka is managed by the Spring Boot BOM imported via Gradle
platform(). Covered by unit tests plus a Testcontainers-Redpanda integration test.

Closes #189
@tiana-code tiana-code added this to the v0.2.0 milestone Jun 18, 2026
@tiana-code
tiana-code merged commit ef831ef into main Jun 18, 2026
8 checks passed
@tiana-code
tiana-code deleted the feat/E-03-eventbus-broker-config branch June 18, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F-03.3 Kafka/Redpanda configuration (Redpanda default, Kafka profile)

1 participant