Skip to content

Commit

Permalink
review fix
Browse files Browse the repository at this point in the history
* rename `HandlerMethodDetect` to `AsyncRepliesAware`
* fix javadoc in `ContinuationHandlerMethodArgumentResolver`
  • Loading branch information
Wzy19930507 committed Jan 19, 2024
1 parent 6a9757f commit bf8bb23
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
import org.springframework.kafka.listener.ContainerProperties.AckMode;
import org.springframework.kafka.listener.ContainerProperties.AssignmentCommitOption;
import org.springframework.kafka.listener.ContainerProperties.EOSMode;
import org.springframework.kafka.listener.adapter.HandlerMethodDetect;
import org.springframework.kafka.listener.adapter.AsyncRepliesAware;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.kafka.support.KafkaHeaders;
import org.springframework.kafka.support.KafkaUtils;
Expand Down Expand Up @@ -854,7 +854,7 @@ private final class ListenerConsumer implements SchedulingAwareRunnable, Consume
ListenerConsumer(GenericMessageListener<?> listener, ListenerType listenerType,
ObservationRegistry observationRegistry) {

this.asyncReplies = listener instanceof HandlerMethodDetect hmd && hmd.isAsyncReplies()
this.asyncReplies = listener instanceof AsyncRepliesAware hmd && hmd.isAsyncReplies()
|| this.containerProperties.isAsyncAcks();
AckMode ackMode = determineAckMode();
this.isManualAck = ackMode.equals(AckMode.MANUAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package org.springframework.kafka.listener.adapter;

/**
* Auto-detect {@link HandlerAdapter} args and return type.
* Auto-detect {@link HandlerAdapter} return type.
*
* @author Wang zhiyang
* @since 3.2
*/
public interface HandlerMethodDetect {
public interface AsyncRepliesAware {

/**
* Return true if this listener is request/reply and the replies are async.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

package org.springframework.kafka.listener.adapter;

import org.springframework.core.MethodParameter;
import org.springframework.messaging.Message;
import org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver;

import reactor.core.publisher.Mono;

/**
* No-op resolver for method arguments of type {@link kotlin.coroutines.Continuation}.
* <p>
Expand All @@ -24,17 +30,9 @@
* but for regular {@link HandlerMethodArgumentResolver} contract.
*
* @author Wang Zhiyang
*
* @since 3.2
*
* @see org.springframework.messaging.handler.annotation.reactive.ContinuationHandlerMethodArgumentResolver
*/
import org.springframework.core.MethodParameter;
import org.springframework.messaging.Message;
import org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver;

import reactor.core.publisher.Mono;

public class ContinuationHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
* @author Nathan Xu
* @author Wang ZhiYang
*/
public abstract class MessagingMessageListenerAdapter<K, V> implements ConsumerSeekAware, HandlerMethodDetect {
public abstract class MessagingMessageListenerAdapter<K, V> implements ConsumerSeekAware, AsyncRepliesAware {

private static final SpelExpressionParser PARSER = new SpelExpressionParser();

Expand Down

0 comments on commit bf8bb23

Please sign in to comment.