final class KafkaProducer[K, V] extends KafkaProducerLike[K, V]

Wraps the Java KafkaProducer providing send operations that indicate the result of the operation with either a Scala Future or a Function callback.

K

type of the key that the producer accepts

V

type of the value that the producer accepts

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. KafkaProducer
  2. KafkaProducerLike
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KafkaProducer(producer: Producer[K, V])

    producer

    the underlying Java KafkaProducer

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to any2stringadd[KafkaProducer[K, V]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (KafkaProducer[K, V], B)
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to ArrowAssoc[KafkaProducer[K, V]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def abortTransaction(): Unit

    Aborts the transaction.

    Aborts the transaction.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer abortTransaction method

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def beginTransaction(): Unit

    Begin the transaction.

    Begin the transaction.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer beginTransactions method

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  10. def close(timeout: FiniteDuration): Unit

    Close this producer.

    Close this producer.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer close method

  11. def close(): Unit

    Close this producer.

    Close this producer.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer close method

  12. def commitTransaction(): Unit

    Commits the transaction.

    Commits the transaction.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer commitTransaction method

  13. def ensuring(cond: (KafkaProducer[K, V]) ⇒ Boolean, msg: ⇒ Any): KafkaProducer[K, V]
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to Ensuring[KafkaProducer[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (KafkaProducer[K, V]) ⇒ Boolean): KafkaProducer[K, V]
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to Ensuring[KafkaProducer[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): KafkaProducer[K, V]
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to Ensuring[KafkaProducer[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): KafkaProducer[K, V]
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to Ensuring[KafkaProducer[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. def flush(): Unit

    Make all buffered records immediately available to send and wait until records have been sent.

    Make all buffered records immediately available to send and wait until records have been sent.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer flush method

  20. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to StringFormat[KafkaProducer[K, V]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. def initTransactions(): Unit

    Initialise a transaction.

    Initialise a transaction.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer initTransactions method

  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. def partitionsFor(topic: String): List[PartitionInfo]

    Get the partition metadata for the give topic.

    Get the partition metadata for the give topic.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer partitionsFor method

  29. val producer: Producer[K, V]
  30. def send(record: ProducerRecord[K, V]): Future[RecordMetadata]

    Asynchronously send a record to a topic.

    Asynchronously send a record to a topic.

    record

    ProducerRecord to sent

    returns

    the result of the sent records as a Future

    Definition Classes
    KafkaProducerKafkaProducerLike
  31. def sendOffsetsToTransaction(offsets: Map[TopicPartition, OffsetAndMetadata], consumerGroupId: String): Unit

    Sends a list of consumed offsets to the consumer group coordinator, and also marks those offsets as part of the current transaction.

    Sends a list of consumed offsets to the consumer group coordinator, and also marks those offsets as part of the current transaction.

    Definition Classes
    KafkaProducerKafkaProducerLike
    See also

    Java KafkaProducer sendOffsetsToTransaction method

  32. def sendWithCallback(record: ProducerRecord[K, V])(callback: (Try[RecordMetadata]) ⇒ Unit): Unit

    Asynchronously send a record to a topic and invoke the provided callback when the send has been acknowledged.

    Asynchronously send a record to a topic and invoke the provided callback when the send has been acknowledged.

    record

    ProducerRecord to sent

    callback

    callback that is called when the send has been acknowledged

    Definition Classes
    KafkaProducerKafkaProducerLike
  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. def [B](y: B): (KafkaProducer[K, V], B)
    Implicit
    This member is added by an implicit conversion from KafkaProducer[K, V] to ArrowAssoc[KafkaProducer[K, V]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from KafkaProducerLike[K, V]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from KafkaProducer[K, V] to any2stringadd[KafkaProducer[K, V]]

Inherited by implicit conversion StringFormat from KafkaProducer[K, V] to StringFormat[KafkaProducer[K, V]]

Inherited by implicit conversion Ensuring from KafkaProducer[K, V] to Ensuring[KafkaProducer[K, V]]

Inherited by implicit conversion ArrowAssoc from KafkaProducer[K, V] to ArrowAssoc[KafkaProducer[K, V]]

Ungrouped