Class RqueueMessageListenerContainer
- java.lang.Object
-
- com.github.sonus21.rqueue.listener.RqueueMessageListenerContainer
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
public class RqueueMessageListenerContainer extends java.lang.Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.context.SmartLifecycle, org.springframework.beans.factory.BeanNameAware
Container providing asynchronous behaviour for Rqueue message listeners. Handles the low level details of listening, converting and message dispatching.- See Also:
SimpleRqueueListenerContainerFactory
-
-
Constructor Summary
Constructors Constructor Description RqueueMessageListenerContainer(RqueueMessageHandler rqueueMessageHandler, RqueueMessageTemplate rqueueMessageTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
org.springframework.core.task.AsyncTaskExecutor
createDefaultTaskExecutor(java.util.List<QueueDetail> registeredActiveQueueDetail)
void
destroy()
protected void
doDestroy()
protected void
doStart()
protected void
doStop()
long
getBackOffTime()
java.lang.String
getBeanName()
MessageProcessor
getDeadLetterQueueMessageProcessor()
MessageProcessor
getDiscardMessageProcessor()
MessageProcessor
getManualDeletionMessageProcessor()
java.lang.Integer
getMaxNumWorkers()
long
getMaxWorkerWaitTime()
java.util.List<Middleware>
getMiddleWares()
int
getPhase()
long
getPollingInterval()
MessageProcessor
getPostExecutionMessageProcessor()
MessageProcessor
getPreExecutionMessageProcessor()
PriorityMode
getPriorityMode()
RqueueMessageHandler
getRqueueMessageHandler()
RqueueMessageTemplate
getRqueueMessageTemplate()
TaskExecutionBackOff
getTaskExecutionBackOff()
org.springframework.core.task.AsyncTaskExecutor
getTaskExecutor()
boolean
isAutoStartup()
boolean
isRunning()
void
setAutoStartup(boolean autoStartup)
Control if this component should get started automatically or manually.void
setBackOffTime(long backOffTime)
void
setBeanName(java.lang.String name)
void
setDeadLetterQueueMessageProcessor(MessageProcessor deadLetterQueueMessageProcessor)
void
setDiscardMessageProcessor(MessageProcessor discardMessageProcessor)
void
setManualDeletionMessageProcessor(MessageProcessor manualDeletionMessageProcessor)
void
setMaxNumWorkers(int maxNumWorkers)
void
setMaxWorkerWaitTime(long stopTime)
void
setMiddlewares(java.util.List<Middleware> middlewares)
void
setPhase(int phase)
Configure a custom phase for the container to start.void
setPollingInterval(long pollingInterval)
void
setPostExecutionMessageProcessor(MessageProcessor postExecutionMessageProcessor)
void
setPreExecutionMessageProcessor(MessageProcessor preExecutionMessageProcessor)
void
setPriorityMode(PriorityMode priorityMode)
void
setTaskExecutionBackOff(TaskExecutionBackOff taskExecutionBackOff)
void
setTaskExecutor(org.springframework.core.task.AsyncTaskExecutor taskExecutor)
void
start()
protected void
startGroup(java.lang.String groupName, java.util.List<QueueDetail> queueDetails)
protected void
startQueue(java.lang.String queueName, QueueDetail queueDetail)
void
stop()
void
stop(java.lang.Runnable callback)
-
-
-
Constructor Detail
-
RqueueMessageListenerContainer
public RqueueMessageListenerContainer(RqueueMessageHandler rqueueMessageHandler, RqueueMessageTemplate rqueueMessageTemplate)
-
-
Method Detail
-
getRqueueMessageTemplate
public RqueueMessageTemplate getRqueueMessageTemplate()
-
getMaxWorkerWaitTime
public long getMaxWorkerWaitTime()
-
setMaxWorkerWaitTime
public void setMaxWorkerWaitTime(long stopTime)
-
getBeanName
public java.lang.String getBeanName()
-
setBeanName
public void setBeanName(java.lang.String name)
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
getRqueueMessageHandler
public RqueueMessageHandler getRqueueMessageHandler()
-
getMaxNumWorkers
public java.lang.Integer getMaxNumWorkers()
-
setMaxNumWorkers
public void setMaxNumWorkers(int maxNumWorkers)
-
getBackOffTime
public long getBackOffTime()
-
setBackOffTime
public void setBackOffTime(long backOffTime)
-
destroy
public void destroy() throws java.lang.Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
-
doDestroy
protected void doDestroy()
-
getPhase
public int getPhase()
- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-
setPhase
public void setPhase(int phase)
Configure a custom phase for the container to start. This allows to start other beans that also implements theSmartLifecycle
interface.- Parameters:
phase
- - the phase that defines the phase respecting theOrdered
semantics
-
isAutoStartup
public boolean isAutoStartup()
- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
setAutoStartup
public void setAutoStartup(boolean autoStartup)
-
stop
public void stop(java.lang.Runnable callback)
- Specified by:
stop
in interfaceorg.springframework.context.SmartLifecycle
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
createDefaultTaskExecutor
public org.springframework.core.task.AsyncTaskExecutor createDefaultTaskExecutor(java.util.List<QueueDetail> registeredActiveQueueDetail)
-
start
public void start()
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
doStart
protected void doStart()
-
startGroup
protected void startGroup(java.lang.String groupName, java.util.List<QueueDetail> queueDetails)
-
startQueue
protected void startQueue(java.lang.String queueName, QueueDetail queueDetail)
-
getTaskExecutor
public org.springframework.core.task.AsyncTaskExecutor getTaskExecutor()
-
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.AsyncTaskExecutor taskExecutor)
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
doStop
protected void doStop()
-
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
getPollingInterval
public long getPollingInterval()
-
setPollingInterval
public void setPollingInterval(long pollingInterval)
-
getDiscardMessageProcessor
public MessageProcessor getDiscardMessageProcessor()
-
setDiscardMessageProcessor
public void setDiscardMessageProcessor(MessageProcessor discardMessageProcessor)
-
getDeadLetterQueueMessageProcessor
public MessageProcessor getDeadLetterQueueMessageProcessor()
-
setDeadLetterQueueMessageProcessor
public void setDeadLetterQueueMessageProcessor(MessageProcessor deadLetterQueueMessageProcessor)
-
getManualDeletionMessageProcessor
public MessageProcessor getManualDeletionMessageProcessor()
-
setManualDeletionMessageProcessor
public void setManualDeletionMessageProcessor(MessageProcessor manualDeletionMessageProcessor)
-
getPostExecutionMessageProcessor
public MessageProcessor getPostExecutionMessageProcessor()
-
setPostExecutionMessageProcessor
public void setPostExecutionMessageProcessor(MessageProcessor postExecutionMessageProcessor)
-
getPreExecutionMessageProcessor
public MessageProcessor getPreExecutionMessageProcessor()
-
setPreExecutionMessageProcessor
public void setPreExecutionMessageProcessor(MessageProcessor preExecutionMessageProcessor)
-
getTaskExecutionBackOff
public TaskExecutionBackOff getTaskExecutionBackOff()
-
setTaskExecutionBackOff
public void setTaskExecutionBackOff(TaskExecutionBackOff taskExecutionBackOff)
-
getPriorityMode
public PriorityMode getPriorityMode()
-
setPriorityMode
public void setPriorityMode(PriorityMode priorityMode)
-
setMiddlewares
public void setMiddlewares(java.util.List<Middleware> middlewares)
-
getMiddleWares
public java.util.List<Middleware> getMiddleWares()
-
-