Class KafkaListenerException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.micronaut.messaging.exceptions.MessagingException
io.micronaut.messaging.exceptions.MessageListenerException
io.micronaut.configuration.kafka.exceptions.KafkaListenerException
- All Implemented Interfaces:
Serializable
public class KafkaListenerException
extends io.micronaut.messaging.exceptions.MessageListenerException
Exception thrown when an error occurs processing a
ConsumerRecord
via a KafkaListener
.- Since:
- 1.0
- Author:
- Graeme Rocher
- See Also:
-
Constructor Summary
ConstructorDescriptionKafkaListenerException
(String message, Object listener, Consumer<?, ?> kafkaConsumer, ConsumerRecord<?, ?> consumerRecord) Creates a new exception.KafkaListenerException
(String message, Throwable cause, Object listener, Consumer<?, ?> kafkaConsumer, @Nullable ConsumerRecords<?, ?> consumerRecords, @Nullable ConsumerRecord<?, ?> consumerRecord) Creates a new exception.KafkaListenerException
(String message, Throwable cause, Object listener, Consumer<?, ?> kafkaConsumer, ConsumerRecord<?, ?> consumerRecord) Creates a new exception.KafkaListenerException
(Throwable cause, Object listener, Consumer<?, ?> kafkaConsumer, ConsumerRecord<?, ?> consumerRecord) Creates a new exception. -
Method Summary
Modifier and TypeMethodDescriptionOptional<ConsumerRecord<?,
?>> Optional<ConsumerRecords<?,
?>> Consumer<?,
?> Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
KafkaListenerException
public KafkaListenerException(String message, Object listener, Consumer<?, ?> kafkaConsumer, ConsumerRecord<?, ?> consumerRecord) Creates a new exception.- Parameters:
message
- The messagelistener
- The listenerkafkaConsumer
- The consumerconsumerRecord
- The consumer record
-
KafkaListenerException
public KafkaListenerException(String message, Throwable cause, Object listener, Consumer<?, ?> kafkaConsumer, ConsumerRecord<?, ?> consumerRecord) Creates a new exception.- Parameters:
message
- The messagecause
- The causelistener
- The listenerkafkaConsumer
- The consumerconsumerRecord
- The consumer record
-
KafkaListenerException
public KafkaListenerException(Throwable cause, Object listener, Consumer<?, ?> kafkaConsumer, ConsumerRecord<?, ?> consumerRecord) Creates a new exception.- Parameters:
cause
- The causelistener
- The listenerkafkaConsumer
- The consumerconsumerRecord
- The consumer record
-
KafkaListenerException
public KafkaListenerException(String message, Throwable cause, Object listener, Consumer<?, ?> kafkaConsumer, @Nullable @Nullable ConsumerRecords<?, ?> consumerRecords, @Nullable @Nullable ConsumerRecord<?, ?> consumerRecord) Creates a new exception.- Parameters:
message
- The messagecause
- The causelistener
- The listenerkafkaConsumer
- The consumerconsumerRecords
- The batch of consumer recordsconsumerRecord
- The consumer record
-
-
Method Details
-
getKafkaListener
- Returns:
- The bean that is the kafka listener
-
getKafkaConsumer
- Returns:
- The consumer that produced the error
-
getConsumerRecord
- Returns:
- The consumer record that was being processed that caused the error
-
getConsumerRecords
- Returns:
- The batch of consumer records that was being processed that caused the error
- Since:
- 5.3
-