Package io.awspring.cloud.sqs.config
Class EndpointRegistrar
java.lang.Object
io.awspring.cloud.sqs.config.EndpointRegistrar
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,SmartInitializingSingleton
public class EndpointRegistrar
extends Object
implements BeanFactoryAware, SmartInitializingSingleton
Processes the registered
Endpoint
instances using the appropriate MessageListenerContainerFactory
.
Contains configurations that will be applied to all @SqsListener
containers. Such configurations can be set by declaring SqsListenerConfigurer
beans.- Since:
- 3.0
- Author:
- Tomaz Fernandes
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Get the message converters list consumer.Return theMessageHandlerMethodFactory
to be used to createMessageHandler
instances for theEndpoint
s.Get the method argument resolvers list consumer.com.fasterxml.jackson.databind.ObjectMapper
Get the object mapper used to deserialize payloads.void
manageMessageConverters
(Consumer<List<MessageConverter>> convertersConsumer) Manage the list ofMessageConverter
instances to be used to convert payloads.void
manageMethodArgumentResolvers
(Consumer<List<HandlerMethodArgumentResolver>> resolversConsumer) Manage the list ofHandlerMethodArgumentResolver
instances to be used for resolving method arguments.void
registerEndpoint
(Endpoint endpoint) Register anEndpoint
within this registrar for later processing.void
setBeanFactory
(BeanFactory beanFactory) void
setDefaultListenerContainerFactoryBeanName
(String defaultListenerContainerFactoryBeanName) Set the bean name for the defaultMessageListenerContainerFactory
.void
setListenerContainerRegistry
(MessageListenerContainerRegistry listenerContainerRegistry) Set a customMessageListenerContainerRegistry
.void
setMessageHandlerMethodFactory
(MessageHandlerMethodFactory messageHandlerMethodFactory) Set a customMessageHandlerMethodFactory
implementation.void
setMessageListenerContainerRegistryBeanName
(String messageListenerContainerRegistryBeanName) Set the bean name for theMessageListenerContainerRegistry
.void
setObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Set the object mapper to be used to deserialize payloads fot SqsListener endpoints.
-
Field Details
-
DEFAULT_LISTENER_CONTAINER_FACTORY_BEAN_NAME
- See Also:
-
-
Constructor Details
-
EndpointRegistrar
public EndpointRegistrar()
-
-
Method Details
-
setMessageHandlerMethodFactory
Set a customMessageHandlerMethodFactory
implementation.- Parameters:
messageHandlerMethodFactory
- the instance.
-
setListenerContainerRegistry
public void setListenerContainerRegistry(MessageListenerContainerRegistry listenerContainerRegistry) Set a customMessageListenerContainerRegistry
.- Parameters:
listenerContainerRegistry
- the instance.
-
setDefaultListenerContainerFactoryBeanName
public void setDefaultListenerContainerFactoryBeanName(String defaultListenerContainerFactoryBeanName) Set the bean name for the defaultMessageListenerContainerFactory
.- Parameters:
defaultListenerContainerFactoryBeanName
- the bean name.
-
setMessageListenerContainerRegistryBeanName
public void setMessageListenerContainerRegistryBeanName(String messageListenerContainerRegistryBeanName) Set the bean name for theMessageListenerContainerRegistry
.- Parameters:
messageListenerContainerRegistryBeanName
- the bean name.
-
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Set the object mapper to be used to deserialize payloads fot SqsListener endpoints.- Parameters:
objectMapper
- the object mapper instance.
-
manageMessageConverters
Manage the list ofMessageConverter
instances to be used to convert payloads.- Parameters:
convertersConsumer
- a consumer for the converters list.
-
manageMethodArgumentResolvers
public void manageMethodArgumentResolvers(Consumer<List<HandlerMethodArgumentResolver>> resolversConsumer) Manage the list ofHandlerMethodArgumentResolver
instances to be used for resolving method arguments.- Parameters:
resolversConsumer
- a consumer for the resolvers list.
-
getMessageConverterConsumer
Get the message converters list consumer.- Returns:
- the consumer.
-
getMethodArgumentResolversConsumer
Get the method argument resolvers list consumer.- Returns:
- the consumer.
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Get the object mapper used to deserialize payloads.- Returns:
- the object mapper instance.
-
getMessageHandlerMethodFactory
Return theMessageHandlerMethodFactory
to be used to createMessageHandler
instances for theEndpoint
s.- Returns:
- the factory instance.
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
registerEndpoint
Register anEndpoint
within this registrar for later processing.- Parameters:
endpoint
- the endpoint.
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiated
in interfaceSmartInitializingSingleton
-