Skip to content

How to override/replace SqsListenerAnnotationBeanPostProcessor? #1407

Answered by erizzo-cfa
erizzo-cfa asked this question in Q&A
Discussion options

You must be logged in to vote

Here's what I did to accomplish my goal. Hopefully is can be a useful example for others to follow.

  1. Wrote a POJO class that extends SqsListenerAnnotationBeanPostProcessor, overriding the methods createEndpointRegistrar() and createEndpoint(SqsListener annotation) to avoid creating Endpoints based on my requirement.
  2. Created a @Configuration class that registers my custom processor as a @Bean using the name io.awspring.cloud.sqs.config.SqsBeanNames.SQS_LISTENER_ANNOTATION_BEAN_POST_PROCESSOR_BEAN_NAME.
    I made sure to use @AutoConfigureBefore(SqsAutoConfiguration.clas}) to make my configuration class process before the built-in awspring auto-configure class.
  3. Include the fully qualified name…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by erizzo-cfa
Comment options

You must be logged in to vote
4 replies
@erizzo-cfa
Comment options

@erizzo-cfa
Comment options

@maciejwalkowiak
Comment options

@erizzo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants