Class AdapterUtils
java.lang.Object
org.springframework.kafka.listener.adapter.AdapterUtils
Utilities for listener adapters.
- Since:
- 2.5
- Author:
- Gary Russell, Wang Zhiyang, Huijin Hong
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParserContext
Parser context for runtime SpEL using ! as the template prefix. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConsumerRecordMetadata
Build aConsumerRecordMetadata
from data which must be aConsumerRecord
.static Object
Build aConsumerRecordMetadata
from the firstConsumerRecord
in data, if any.static String
Return the default expression when no SendTo value is present.static boolean
isAsyncReply
(Class<?> resultType) Return the true when return types are asynchronous.static boolean
isCompletableFuture
(Class<?> resultType) Return the true when type isCompletableFuture
.static boolean
isKotlinContinuation
(Class<?> parameterType) Return the true when type isContinuation
.static boolean
Return the true when type isMono
.
-
Field Details
-
PARSER_CONTEXT
Parser context for runtime SpEL using ! as the template prefix.- Since:
- 2.2.15
-
-
Method Details
-
buildConsumerRecordMetadataFromArray
Build aConsumerRecordMetadata
from the firstConsumerRecord
in data, if any.- Parameters:
data
- the data array.- Returns:
- the metadata or null if data does not contain a
ConsumerRecord
.
-
buildConsumerRecordMetadata
Build aConsumerRecordMetadata
from data which must be aConsumerRecord
.- Parameters:
data
- the record.- Returns:
- the metadata or null if data is not a
ConsumerRecord
.
-
getDefaultReplyTopicExpression
Return the default expression when no SendTo value is present.- Returns:
- the expression.
- Since:
- 2.2.15
-
isAsyncReply
Return the true when return types are asynchronous.- Parameters:
resultType
-InvocableHandlerMethod
return type.- Returns:
- type is
Mono
orCompletableFuture
. - Since:
- 3.2
-
isMono
Return the true when type isMono
.- Parameters:
resultType
-InvocableHandlerMethod
return type.- Returns:
- type is
Mono
. - Since:
- 3.2
-
isCompletableFuture
Return the true when type isCompletableFuture
.- Parameters:
resultType
-InvocableHandlerMethod
return type.- Returns:
- type is
CompletableFuture
. - Since:
- 3.2
-
isKotlinContinuation
Return the true when type isContinuation
.- Parameters:
parameterType
-MethodParameter
parameter type.- Returns:
- type is
Continuation
. - Since:
- 3.2.1
-