@Override protected MappingInformation getMappingForMethod(Method method, Class<?> handlerType) { SqsListener sqsListenerAnnotation = AnnotationUtils.findAnnotation(method, SqsListener.class); if (sqsListenerAnnotation != null && sqsListenerAnnotation.value().length > 0) { if (sqsListenerAnnotation.deletionPolicy() == SqsMessageDeletionPolicy.NEVER && hasNoAcknowledgmentParameter(method.getParameterTypes())) { this.logger.warn("Listener method '" + method.getName() + "' in type '" + method.getDeclaringClass().getName() + "' has deletion policy 'NEVER' but does not have a parameter of type Acknowledgment."); } return new MappingInformation(resolveDestinationNames(sqsListenerAnnotation.value()), sqsListenerAnnotation.deletionPolicy()); } MessageMapping messageMappingAnnotation = AnnotationUtils.findAnnotation(method, MessageMapping.class); if (messageMappingAnnotation != null && messageMappingAnnotation.value().length > 0) { return new MappingInformation(resolveDestinationNames(messageMappingAnnotation.value()), SqsMessageDeletionPolicy.ALWAYS); } return null; }
@Override protected MappingInformation getMappingForMethod(Method method, Class<?> handlerType) { SqsListener sqsListenerAnnotation = AnnotationUtils.findAnnotation(method, SqsListener.class); if (sqsListenerAnnotation != null && sqsListenerAnnotation.value().length > 0) { if (sqsListenerAnnotation.deletionPolicy() == SqsMessageDeletionPolicy.NEVER && hasNoAcknowledgmentParameter(method.getParameterTypes())) { this.logger.warn("Listener method '" + method.getName() + "' in type '" + method.getDeclaringClass().getName() + "' has deletion policy 'NEVER' but does not have a parameter of type Acknowledgment."); } return new MappingInformation(resolveDestinationNames(sqsListenerAnnotation.value()), sqsListenerAnnotation.deletionPolicy()); } MessageMapping messageMappingAnnotation = AnnotationUtils.findAnnotation(method, MessageMapping.class); if (messageMappingAnnotation != null && messageMappingAnnotation.value().length > 0) { return new MappingInformation(resolveDestinationNames(messageMappingAnnotation.value()), SqsMessageDeletionPolicy.ALWAYS); } return null; }