public interface CdcConsumer
CdcMain
application invocation.
The lifecycle of the consumer is the following:
start(MetricRegistry)
.onEvents(Iterator)
call.stop()
.IgniteLogger
, please, use, LoggerResource
annotation:
public class ChangeDataCaptureConsumer implements ChangeDataCaptureConsumer { @LoggerResource private IgniteLogger log; ... }Note, consumption of the
CdcEvent
will be started from the last saved offset.
The offset of consumptions is saved on the disk every time onEvents(Iterator)
returns true
.CdcMain
,
CdcEvent
,
CacheEntryVersion
Modifier and Type | Method and Description |
---|---|
boolean |
onEvents(Iterator<CdcEvent> events)
Handles entry changes events.
|
void |
start(org.apache.ignite.internal.processors.metric.MetricRegistry mreg)
Starts the consumer.
|
void |
stop()
Stops the consumer.
|
void start(org.apache.ignite.internal.processors.metric.MetricRegistry mreg)
mreg
- Metric registry for consumer specific metrics.boolean onEvents(Iterator<CdcEvent> events)
true
then current offset will be stored
and ongoing notifications after CDC application fail/restart will be started from it.events
- Entry change events.True
if current offset should be saved on the disk
to continue from it in case any failures or restart.void stop()
start(MetricRegistry)
.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.12.0 Release Date : January 10 2022