Class KafkaPublisher<K,V>
java.lang.Object
io.helidon.messaging.connectors.kafka.KafkaPublisher<K,V>
- Type Parameters:
K
- Key typeV
- Value type
- All Implemented Interfaces:
Publisher<KafkaMessage<K,
V>>
This is an implementation of
Publisher
that read messages from
Kafka and push them downstream to one subscriber.
Configurable by Helidon Config
,- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> KafkaPublisher.Builder<K, V> builder()
A builder for KafkaPublisher.static <K,
V> KafkaPublisher<K, V> Load this builder from a configuration.protected void
runInNewContext
(Runnable runnable) void
stop()
Closes the opened resources to Kafka and completes exceptionally the pendingMessage.ack()
.void
subscribe
(Subscriber<? super KafkaMessage<K, V>> subscriber)
-
Method Details
-
stop
public void stop()Closes the opened resources to Kafka and completes exceptionally the pendingMessage.ack()
. It must be invoked afterScheduledExecutorService
is shutdown. -
runInNewContext
-
subscribe
-
builder
A builder for KafkaPublisher.- Type Parameters:
K
- Key typeV
- Value type- Returns:
- builder to create a new instance
-
create
Load this builder from a configuration.- Type Parameters:
K
- Key typeV
- Value type- Parameters:
config
- configuration to load from- Returns:
- updated builder instance
-