Tentacolous 0.3.0¶
Version 0.3.0 adds message-broker sinks. Every database change detected by Tentacolous can now be
forwarded to Kafka or RabbitMQ, in addition to (or instead of) calling in-process listener methods.
The listener and filter API from 0.2.0 is unchanged.
Installation¶
<dependency>
<groupId>io.github.aimtone</groupId>
<artifactId>tentacolous</artifactId>
<version>0.3.0</version>
</dependency>
Add spring-kafka or spring-boot-starter-amqp to your application only when you enable the
matching sink. Tentacolous declares both as optional dependencies.
What is new¶
ChangeEventSinkSPI. Any Spring bean implementing it receives every detected change after the listener methods run. Delivery is at-least-once; a sink failure keeps the eventPENDINGand reuses the existing retry flow. Deduplicate oneventId.- Kafka sink (
tentacolous.kafka.*). One record per event, keyed by the record key for per-row ordering, withacks=alland producer idempotence by default. - RabbitMQ sink (
tentacolous.rabbitmq.*). Publishes to a durable topic exchange with routing keyentity.operation. - Message formats.
envelope(default, withbefore/afterand metadata) orraw. The headerstentacolous-event-id,tentacolous-entityandtentacolous-operationare always set. - Captures. Forward a table to the configured sinks without writing a listener method, via the
@TentacolousCaptureannotation or an equivalentCapturebean. Both accept the same options as the@Upon...annotations — operations,entityName,exclude, a declarative filter, a programmaticTentacolousFilter, andorder— and their filters decide which changes reach the sinks.
Minimal configuration¶
spring:
kafka:
bootstrap-servers: localhost:9092
rabbitmq:
host: localhost
username: guest
password: guest
tentacolous:
kafka:
enabled: true
topic-prefix: "cdc."
rabbitmq:
enabled: true
exchange: tentacolous
Compatibility¶
- Existing
0.2.xapplications are unaffected: the sinks are opt-in and the broker dependencies are optional. - All six database dialects (PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite) are supported
as in
0.2.0.
See the current technical guide for the complete API and configuration reference, including the Message brokers section.