public class SimpleMessageListenerContainerFactory extends Object
| Constructor and Description |
|---|
SimpleMessageListenerContainerFactory() |
| Modifier and Type | Method and Description |
|---|---|
SimpleMessageListenerContainer |
createSimpleMessageListenerContainer() |
com.amazonaws.services.sqs.AmazonSQS |
getAmazonSqs() |
Long |
getBackOffTime() |
QueueMessageHandler |
getQueueMessageHandler() |
org.springframework.cloud.aws.core.env.ResourceIdResolver |
getResourceIdResolver() |
void |
setAmazonSqs(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs)
Sets the
AmazonSQSAsync that is going to be used by the container to interact
with the messaging (SQS) API. |
void |
setAutoStartup(boolean autoStartup)
Configures if this container should be automatically started.
|
void |
setBackOffTime(Long backOffTime)
The number of milliseconds the polling thread must wait before trying to recover when an error occurs
(e.g.
|
void |
setDeleteMessageOnException(Boolean deleteMessageOnException)
Defines if a message must be deleted or not if the handler method throws an exception and the exception handler
method is called.
|
void |
setDestinationResolver(org.springframework.messaging.core.DestinationResolver<String> destinationResolver)
Configures the destination resolver used to retrieve the queue url based on the destination name configured for
this instance.
|
void |
setMaxNumberOfMessages(Integer maxNumberOfMessages)
Configure the maximum number of messages that should be retrieved during one poll to the Amazon SQS system.
|
void |
setQueueMessageHandler(QueueMessageHandler messageHandler)
Configures the
QueueMessageHandler that must be used
to handle incoming messages. |
void |
setResourceIdResolver(org.springframework.cloud.aws.core.env.ResourceIdResolver resourceIdResolver)
This value must be set if no destination resolver has been set.
|
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Configures the
TaskExecutor which is used to poll messages and execute them
by calling the handler methods. |
void |
setVisibilityTimeout(Integer visibilityTimeout)
Configures the duration (in seconds) that the received messages are hidden from
subsequent poll requests after being retrieved from the system.
|
void |
setWaitTimeOut(Integer waitTimeOut)
Configures the wait timeout that the poll request will wait for new message to arrive if the are currently no
messages on the queue.
|
public SimpleMessageListenerContainerFactory()
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
TaskExecutor which is used to poll messages and execute them
by calling the handler methods.
If no TaskExecutor is set, a default one is created.taskExecutor - The TaskExecutor used by the containerSimpleMessageListenerContainer.createDefaultTaskExecutor()public void setMaxNumberOfMessages(Integer maxNumberOfMessages)
maxNumberOfMessages - the maximum number of messages (between 1-10)public void setVisibilityTimeout(Integer visibilityTimeout)
visibilityTimeout - the visibility timeout in secondspublic void setWaitTimeOut(Integer waitTimeOut)
waitTimeOut - - the wait time out in secondspublic void setAutoStartup(boolean autoStartup)
autoStartup - - false if the container will be manually startedpublic void setAmazonSqs(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs)
AmazonSQSAsync that is going to be used by the container to interact
with the messaging (SQS) API.amazonSqs - The AmazonSQSAsync, must not be null.public com.amazonaws.services.sqs.AmazonSQS getAmazonSqs()
public void setQueueMessageHandler(QueueMessageHandler messageHandler)
QueueMessageHandler that must be used
to handle incoming messages.
NOTE: It is rather unlikely that the QueueMessageHandler
must be configured with this setter. Consider using the
QueueMessageHandlerFactory to configure the
QueueMessageHandler before using this setter.
messageHandler - the QueueMessageHandler that must be used by the
container, must not be null.QueueMessageHandlerFactorypublic QueueMessageHandler getQueueMessageHandler()
public void setResourceIdResolver(org.springframework.cloud.aws.core.env.ResourceIdResolver resourceIdResolver)
resourceIdResolver - the resourceIdResolver to use for resolving logical to physical ids in a CloudFormation environment.
Must not be null.public org.springframework.cloud.aws.core.env.ResourceIdResolver getResourceIdResolver()
public void setDestinationResolver(org.springframework.messaging.core.DestinationResolver<String> destinationResolver)
DestinationResolver
must be provided. (For example if one want to have the DynamicQueueUrlDestinationResolver
with the auto creation of queues set to true.destinationResolver - another or customized DestinationResolverpublic void setDeleteMessageOnException(Boolean deleteMessageOnException)
true which means that the message is deleted to avoid
poison messages. If this value is set to false it is the responsibility of the exception handler method to delete
the message. The exception handler method can inject the message headers with Headers
in order to get the receipt handle.deleteMessageOnException - whether a message must be deleted or not when the handler method throws an exceptionpublic Long getBackOffTime()
public void setBackOffTime(Long backOffTime)
backOffTime - in millisecondspublic SimpleMessageListenerContainer createSimpleMessageListenerContainer()
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.