object KafkaProducerRecord
Helper functions for creating Kafka's ProducerRecords.
The producer records hold the data that is to be written to Kafka.
The producer records are compatible with Kafka's own KafkaProducer and the KafkaProducer in this library.
- Alphabetic
- By Inheritance
- KafkaProducerRecord
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
Destination(topic: Topic, partition: Option[Partition]) extends Product with Serializable
Destination for Kafka producer records.
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
-
def
apply[Key >: Null, Value](topicPartitionSelection: Destination, key: Option[Key] = None, value: Value, timestamp: Option[Long] = None): ProducerRecord[Key, Value]
Create a producer record from a topic selection, optional key, value, and optional timestamp.
Create a producer record from a topic selection, optional key, value, and optional timestamp.
- Key
type of the key
- Value
type of the value
- topicPartitionSelection
the topic (with optional partition) where the record will be appended to
- key
the key that will be included in the record
- value
the value that will be included in the record
- timestamp
the timestamp of the record
- returns
producer record
-
def
apply[Key, Value](topic: String, value: Value): ProducerRecord[Key, Value]
Create a producer record without a key.
Create a producer record without a key.
- Key
type of the key
- Value
type of the value
- topic
topic to which record is being sent
- value
the value that will be included in the record
- returns
producer record
-
def
apply[Key, Value](topic: String, key: Key, value: Value): ProducerRecord[Key, Value]
Create a producer record with topic, key, and value.
Create a producer record with topic, key, and value.
- Key
type of the key
- Value
type of the value
- topic
the topic where the record will be appended to
- key
the key that will be included in the record
- value
the value that will be included in the record
- returns
producer record
-
def
apply[Key, Value](topic: String, key: Option[Key], value: Value): ProducerRecord[Key, Value]
Create a producer record with an optional key.
Create a producer record with an optional key.
- Key
type of the key
- Value
type of the value
- topic
the topic where the record will be appended to
- key
optional key that will be included in the record
- value
the value that will be included in the record
- returns
producer record
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fromKeyValues[Key, Value](topic: String, keyValues: Seq[(Option[Key], Value)]): Seq[ProducerRecord[Key, Value]]
Create producer records from key-value pairs.
Create producer records from key-value pairs. All the records will have the given topic.
- topic
topic to write the records to
- keyValues
a sequence of key and value pairs
-
def
fromKeyValuesWithTopic[Key, Value](keyValuesWithTopic: Iterable[(String, Option[Key], Value)]): Iterable[ProducerRecord[Key, Value]]
Create producer records from topic, key, and value triples.
Create producer records from topic, key, and value triples.
- keyValuesWithTopic
a sequence of topic, key, and value triples.
-
def
fromValues[Value](topic: String, values: Seq[Value]): Seq[ProducerRecord[Nothing, Value]]
Create producer records from a sequence of values.
Create producer records from a sequence of values. All the records will have the given topic and no key.
- topic
topic to write the records to
- values
values of the records
-
def
fromValuesWithKey[Key, Value](topic: String, key: Option[Key], values: Seq[Value]): Seq[ProducerRecord[Key, Value]]
Create producer records from a single key and multiple values.
Create producer records from a single key and multiple values. All the records will have the given topic and key.
- topic
topic to write the records to
- key
key of the records
- values
values of the records
-
def
fromValuesWithTopic[Value](valuesWithTopic: Seq[(String, Value)]): Seq[ProducerRecord[Nothing, Value]]
Create producer records from topics and values.
Create producer records from topics and values. All the records will have no key.
- valuesWithTopic
a sequence of topic and value pairs
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
object
Destination extends Serializable
Destination for Kafka producer records.