trait ProducerOps[C <: EmbeddedKafkaConfig] extends AnyRef
- Alphabetic
- By Inheritance
- ProducerOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
producerPublishTimeout: FiniteDuration
- Attributes
- protected
-
def
publishStringMessageToKafka(topic: String, message: String)(implicit config: C): Unit
Publishes synchronously a message of type String to the running Kafka broker.
Publishes synchronously a message of type String to the running Kafka broker.
- topic
the topic to which publish the message (it will be auto-created)
- message
the String message to publish
- config
an implicit EmbeddedKafkaConfig
- Exceptions thrown
KafkaUnavailableException
if unable to connect to Kafka- See also
-
def
publishToKafka[K, T](topic: String, messages: Seq[(K, T)])(implicit config: C, keySerializer: Serializer[K], serializer: Serializer[T]): Unit
Publishes synchronously a batch of message to the running Kafka broker.
Publishes synchronously a batch of message to the running Kafka broker.
- topic
the topic to which publish the message (it will be auto-created)
- messages
the keys and messages of type T) to publish
- config
an implicit EmbeddedKafkaConfig
- keySerializer
an implicit Serializer for the type K
- serializer
an implicit Serializer for the type T
- Annotations
- @throws( classOf[KafkaUnavailableException] )
- Exceptions thrown
KafkaUnavailableException
if unable to connect to Kafka
-
def
publishToKafka[K, T](topic: String, key: K, message: T)(implicit config: C, keySerializer: Serializer[K], serializer: Serializer[T]): Unit
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
- topic
the topic to which publish the message (it will be auto-created)
- key
the key of type K to publish
- message
the message of type T to publish
- config
an implicit EmbeddedKafkaConfig
- serializer
an implicit Serializer for the type T
- Annotations
- @throws( classOf[KafkaUnavailableException] )
- Exceptions thrown
KafkaUnavailableException
if unable to connect to Kafka
-
def
publishToKafka[T](producerRecord: ProducerRecord[String, T])(implicit config: C, serializer: Serializer[T]): Unit
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
- producerRecord
the producerRecord of type T to publish
- config
an implicit EmbeddedKafkaConfig
- serializer
an implicit Serializer for the type T
- Annotations
- @throws( classOf[KafkaUnavailableException] )
- Exceptions thrown
KafkaUnavailableException
if unable to connect to Kafka
-
def
publishToKafka[T](topic: String, message: T)(implicit config: C, serializer: Serializer[T]): Unit
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
- topic
the topic to which publish the message (it will be auto-created)
- message
the message of type T to publish
- config
an implicit EmbeddedKafkaConfig
- serializer
an implicit Serializer for the type T
- Annotations
- @throws( classOf[KafkaUnavailableException] )
- Exceptions thrown
KafkaUnavailableException
if unable to connect to Kafka
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withProducer[K, V, T](body: (KafkaProducer[K, V]) ⇒ T)(implicit config: C, keySerializer: Serializer[K], valueSerializer: Serializer[V]): T
Loaner pattern that allows running a code block with a newly created consumer.
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.
- body
the function to execute that returns T
- config
an implicit EmbeddedKafkaConfig
- keySerializer
an implicit Serializer for the type K
- valueSerializer
an implicit Serializer for the type V
Deprecated Value Members
-
def
kafkaProducer[K, T](topic: String, key: K, message: T)(implicit config: C, keySerializer: Serializer[K], serializer: Serializer[T]): KafkaProducer[K, T]
- Annotations
- @deprecated
- Deprecated
(Since version 2.4.1) Direct usage of KafkaProducer is discouraged, see loan method withProducer
-
object
aKafkaProducer
- Annotations
- @deprecated
- Deprecated
(Since version 2.4.1) Direct usage of KafkaProducer is discouraged, see loan method withProducer