ProducerOps
Trait for Producer-related actions.
Type parameters
- C
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Publishes synchronously a message of type String
to the running Kafka broker.
Publishes synchronously a message of type String
to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- message
-
the message to publish
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- message
-
the message of type
T
to publish - serializer
-
an implicit
Serializer
for the typeT
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- producerRecord
-
the producerRecord of type
T
to publish - serializer
-
an implicit
Serializer
for the typeT
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- key
-
the key of type
K
to publish - message
-
the message of type
T
to publish - serializer
-
an implicit
Serializer
for the typeT
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
Publishes synchronously a batch of message to the running Kafka broker.
Publishes synchronously a batch of message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- keySerializer
-
an implicit
Serializer
for the typeK
- messages
-
the keys and messages of type
(K, T)
to publish - serializer
-
an implicit
Serializer
for the typeT
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
Loaner pattern that allows running a code block with a newly created consumer. The consumer's lifecycle will be automatically handled and closed at the end of the given code block.
Loaner pattern that allows running a code block with a newly created consumer. The consumer's lifecycle will be automatically handled and closed at the end of the given code block.
Value parameters
- body
-
the function to execute that returns
T
- config
-
an implicit EmbeddedKafkaConfig
- keySerializer
-
an implicit
Serializer
for the typeK
- valueSerializer
-
an implicit
Serializer
for the typeV