Package org.springframework.kafka.core
Class KafkaProducerException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.kafka.KafkaException
org.springframework.kafka.core.KafkaProducerException
- All Implemented Interfaces:
Serializable
Exceptions when producing.
- Author:
- Gary Russell
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.kafka.KafkaException
KafkaException.Level
-
Constructor Summary
ConstructorDescriptionKafkaProducerException
(org.apache.kafka.clients.producer.ProducerRecord<?, ?> failedProducerRecord, String message, Throwable cause) Construct an instance with the provided properties. -
Method Summary
Modifier and TypeMethodDescription<K,
V> org.apache.kafka.clients.producer.ProducerRecord<K, V> Return the failed producer record.Methods inherited from class org.springframework.kafka.KafkaException
selfLog
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
KafkaProducerException
public KafkaProducerException(org.apache.kafka.clients.producer.ProducerRecord<?, ?> failedProducerRecord, String message, Throwable cause) Construct an instance with the provided properties.- Parameters:
failedProducerRecord
- the producer record.message
- the message.cause
- the cause.
-
-
Method Details
-
getFailedProducerRecord
public <K,V> org.apache.kafka.clients.producer.ProducerRecord<K,V> getFailedProducerRecord()Return the failed producer record.- Type Parameters:
K
- the key type.V
- the value type.- Returns:
- the record.
- Since:
- 2.5
-