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:
java.io.Serializable
public class KafkaProducerException extends KafkaException
Exceptions when producing.- Author:
- Gary Russell
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.springframework.kafka.KafkaException
KafkaException.Level
-
-
Constructor Summary
Constructors Constructor Description KafkaProducerException(org.apache.kafka.clients.producer.ProducerRecord<?,?> failedProducerRecord, java.lang.String message, java.lang.Throwable cause)
Construct an instance with the provided properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <K,V>
org.apache.kafka.clients.producer.ProducerRecord<K,V>getFailedProducerRecord()
Return the failed producer record.org.apache.kafka.clients.producer.ProducerRecord<?,?>
getProducerRecord()
Deprecated.in favor ofgetFailedProducerRecord()
-
Methods inherited from class org.springframework.kafka.KafkaException
selfLog
-
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
-
-
-
-
Constructor Detail
-
KafkaProducerException
public KafkaProducerException(org.apache.kafka.clients.producer.ProducerRecord<?,?> failedProducerRecord, java.lang.String message, java.lang.Throwable cause)
Construct an instance with the provided properties.- Parameters:
failedProducerRecord
- the producer record.message
- the message.cause
- the cause.
-
-
Method Detail
-
getProducerRecord
@Deprecated public org.apache.kafka.clients.producer.ProducerRecord<?,?> getProducerRecord()
Deprecated.in favor ofgetFailedProducerRecord()
Return the failed producer record.- Returns:
- the record.
-
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
-
-