Class TimestampedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.springframework.core.NestedRuntimeException
-
- org.springframework.kafka.KafkaException
-
- org.springframework.kafka.listener.TimestampedException
-
- All Implemented Interfaces:
java.io.Serializable
public class TimestampedException extends KafkaException
AKafkaException
that records the timestamp of when it was thrown.- Since:
- 2.7
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.springframework.kafka.KafkaException
KafkaException.Level
-
-
Constructor Summary
Constructors Constructor Description TimestampedException(java.lang.Exception ex)
Constructs an instance with the provided cause and the current time.TimestampedException(java.lang.Exception ex, long timestamp)
Creates an instance with the timestamp of when it was thrown and its cause.TimestampedException(java.lang.Exception ex, java.time.Clock clock)
Deprecated.TimestampedException(java.lang.Exception ex, java.time.Instant now)
Creates an instance with the Instant of when it was thrown and its cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getTimestamp()
-
Methods inherited from class org.springframework.kafka.KafkaException
selfLog
-
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
-
-
-
-
Constructor Detail
-
TimestampedException
@Deprecated public TimestampedException(java.lang.Exception ex, java.time.Clock clock)
Deprecated.
-
TimestampedException
public TimestampedException(java.lang.Exception ex)
Constructs an instance with the provided cause and the current time.- Parameters:
ex
- the exception cause.
-
TimestampedException
public TimestampedException(java.lang.Exception ex, long timestamp)
Creates an instance with the timestamp of when it was thrown and its cause.- Parameters:
ex
- the exception cause.timestamp
- the millis from epoch of when the exception was thrown.- Since:
- 2.7.13
-
TimestampedException
public TimestampedException(java.lang.Exception ex, java.time.Instant now)
Creates an instance with the Instant of when it was thrown and its cause.- Parameters:
ex
- the exception cause.now
- the Instant of when the exception was thrown.- Since:
- 2.7.13
-
-