クラス ListenerContainerFactoryBean
- java.lang.ObjectSE
-
- org.springframework.beans.factory.config.AbstractFactoryBean<AbstractMessageListenerContainer>
-
- org.springframework.amqp.rabbit.config.ListenerContainerFactoryBean
- 実装されたすべてのインターフェース:
Aware
、BeanClassLoaderAware
、BeanFactoryAware
、BeanNameAware
、DisposableBean
、FactoryBean<AbstractMessageListenerContainer>
、InitializingBean
、ApplicationContextAware
、ApplicationEventPublisherAware
、Lifecycle
、Phased
、SmartLifecycle
public class ListenerContainerFactoryBean extends AbstractFactoryBean<AbstractMessageListenerContainer> implements ApplicationContextAware, BeanNameAware, ApplicationEventPublisherAware, SmartLifecycle
リスナーコンテナーを作成するためのファクトリ Bean。- 導入:
- 2.0
- 作成者:
- Gary Russell, Artem Bilan, Johno Crawford
ネストされたクラスのサマリー
ネストされたクラス 修飾子と型 クラス 説明 static class
ListenerContainerFactoryBean.Type
コンテナーの種類。
フィールドサマリー
クラス org.springframework.beans.factory.config.AbstractFactoryBean から継承されたフィールド
logger
インターフェース org.springframework.beans.factory.FactoryBean から継承されたフィールド
OBJECT_TYPE_ATTRIBUTE
インターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASE
コンストラクターのサマリー
コンストラクター コンストラクター 説明 ListenerContainerFactoryBean()
メソッドのサマリー
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 protected AbstractMessageListenerContainer
createInstance()
ClassSE<?>
getObjectType()
int
getPhase()
boolean
isAutoStartup()
boolean
isRunning()
void
setAcknowledgeMode(AcknowledgeMode acknowledgeMode)
void
setAdviceChain(Advice... adviceChain)
void
setAfterReceivePostProcessors(MessagePostProcessor... afterReceivePostProcessors)
void
setApplicationContext(ApplicationContext applicationContext)
void
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
void
setAutoDeclare(boolean autoDeclare)
void
setAutoStartup(boolean autoStartup)
void
setBatchSize(int batchSize)
このプロパティにはいくつかの機能があります。void
setBeanName(StringSE beanName)
void
setChannelTransacted(boolean transactional)
void
setConcurrentConsumers(int concurrentConsumers)
void
setConnectionFactory(ConnectionFactory connectionFactory)
void
setConsecutiveActiveTrigger(int consecutiveActiveTrigger)
void
setConsecutiveIdleTrigger(int consecutiveIdleTrigger)
void
setConsumerArguments(MapSE<StringSE,ObjectSE> args)
void
setConsumerBatchEnabled(boolean consumerBatchEnabled)
コンテナーとリスナーがサポートしている場合、setBatchSize(int)
に基づいてメッセージのリストを表示するには、true に設定します。void
setConsumersPerQueue(int consumersPerQueue)
void
setConsumerTagStrategy(ConsumerTagStrategy consumerTagStrategy)
void
setDeBatchingEnabled(boolean deBatchingEnabled)
void
setDeclarationRetries(int declarationRetries)
void
setDefaultRequeueRejected(boolean defaultRequeueRejected)
void
setErrorHandler(ErrorHandler errorHandler)
void
setExclusive(boolean exclusive)
void
setExclusiveConsumerExceptionLogger(ConditionalExceptionLogger exclusiveConsumerExceptionLogger)
void
setExposeListenerChannel(boolean exposeListenerChannel)
void
setFailedDeclarationRetryInterval(long failedDeclarationRetryInterval)
void
setGlobalQos(boolean globalQos)
チャネル全体にプリフェッチを適用します。void
setIdleEventInterval(long idleEventInterval)
void
setListenerId(StringSE listenerId)
void
setMaxConcurrentConsumers(int maxConcurrentConsumers)
void
setMessageListener(MessageListener messageListener)
void
setMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)
void
setMismatchedQueuesFatal(boolean mismatchedQueuesFatal)
void
setMissingQueuesFatal(boolean missingQueuesFatal)
void
setMonitorInterval(long monitorInterval)
void
setNoLocal(BooleanSE noLocal)
void
setPhase(int phase)
void
setPossibleAuthenticationFailureFatal(BooleanSE possibleAuthenticationFailureFatal)
void
setPrefetchCount(int prefetchCount)
void
setQueueNames(StringSE... queueName)
void
setQueues(Queue... queues)
void
setRabbitAdmin(RabbitAdmin rabbitAdmin)
void
setReceiveTimeout(long receiveTimeout)
void
setRecoveryBackOff(BackOff recoveryBackOff)
void
setRecoveryInterval(long recoveryInterval)
void
setRetryDeclarationInterval(long retryDeclarationInterval)
void
setShutdownTimeout(long shutdownTimeout)
void
setStartConsumerMinInterval(long startConsumerMinInterval)
void
setStopConsumerMinInterval(long stopConsumerMinInterval)
void
setTaskExecutor(ExecutorSE taskExecutor)
void
setTaskScheduler(TaskScheduler taskScheduler)
void
setTransactionAttribute(TransactionAttribute transactionAttribute)
void
setTransactionManager(PlatformTransactionManager transactionManager)
void
setType(ListenerContainerFactoryBean.Type type)
void
start()
void
stop()
void
stop(RunnableSE callback)
クラス org.springframework.beans.factory.config.AbstractFactoryBean から継承されたメソッド
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
メソッドの詳細
setApplicationEventPublisher
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
- 次で指定:
- インターフェース
ApplicationEventPublisherAware
のsetApplicationEventPublisher
setBeanName
public void setBeanName(StringSE beanName)
- 次で指定:
- インターフェース
BeanNameAware
のsetBeanName
setApplicationContext
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
- 次で指定:
- インターフェース
ApplicationContextAware
のsetApplicationContext
- 例外:
BeansException
setType
public void setType(ListenerContainerFactoryBean.Type type)
setConnectionFactory
public void setConnectionFactory(ConnectionFactory connectionFactory)
setChannelTransacted
public void setChannelTransacted(boolean transactional)
setAcknowledgeMode
public void setAcknowledgeMode(AcknowledgeMode acknowledgeMode)
setQueueNames
public void setQueueNames(StringSE... queueName)
setQueues
public void setQueues(Queue... queues)
setExposeListenerChannel
public void setExposeListenerChannel(boolean exposeListenerChannel)
setMessageListener
public void setMessageListener(MessageListener messageListener)
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
setDeBatchingEnabled
public void setDeBatchingEnabled(boolean deBatchingEnabled)
setAdviceChain
public void setAdviceChain(Advice... adviceChain)
setAfterReceivePostProcessors
public void setAfterReceivePostProcessors(MessagePostProcessor... afterReceivePostProcessors)
setAutoStartup
public void setAutoStartup(boolean autoStartup)
setPhase
public void setPhase(int phase)
setListenerId
public void setListenerId(StringSE listenerId)
setConsumerTagStrategy
public void setConsumerTagStrategy(ConsumerTagStrategy consumerTagStrategy)
setNoLocal
public void setNoLocal(BooleanSE noLocal)
setExclusive
public void setExclusive(boolean exclusive)
setDefaultRequeueRejected
public void setDefaultRequeueRejected(boolean defaultRequeueRejected)
setPrefetchCount
public void setPrefetchCount(int prefetchCount)
setGlobalQos
public void setGlobalQos(boolean globalQos)
チャネル全体にプリフェッチを適用します。- パラメーター:
globalQos
- チャネル全体のプリフェッチの場合は true。- 導入:
- 2.2.17
- 関連事項:
Channel.basicQos(int, boolean)
setShutdownTimeout
public void setShutdownTimeout(long shutdownTimeout)
setIdleEventInterval
public void setIdleEventInterval(long idleEventInterval)
setTransactionManager
public void setTransactionManager(PlatformTransactionManager transactionManager)
setTransactionAttribute
public void setTransactionAttribute(TransactionAttribute transactionAttribute)
setTaskExecutor
public void setTaskExecutor(ExecutorSE taskExecutor)
setRecoveryInterval
public void setRecoveryInterval(long recoveryInterval)
setRecoveryBackOff
public void setRecoveryBackOff(BackOff recoveryBackOff)
setMessagePropertiesConverter
public void setMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)
setRabbitAdmin
public void setRabbitAdmin(RabbitAdmin rabbitAdmin)
setMissingQueuesFatal
public void setMissingQueuesFatal(boolean missingQueuesFatal)
setPossibleAuthenticationFailureFatal
public void setPossibleAuthenticationFailureFatal(BooleanSE possibleAuthenticationFailureFatal)
setMismatchedQueuesFatal
public void setMismatchedQueuesFatal(boolean mismatchedQueuesFatal)
setAutoDeclare
public void setAutoDeclare(boolean autoDeclare)
setFailedDeclarationRetryInterval
public void setFailedDeclarationRetryInterval(long failedDeclarationRetryInterval)
setExclusiveConsumerExceptionLogger
public void setExclusiveConsumerExceptionLogger(ConditionalExceptionLogger exclusiveConsumerExceptionLogger)
setConsumersPerQueue
public void setConsumersPerQueue(int consumersPerQueue)
setTaskScheduler
public void setTaskScheduler(TaskScheduler taskScheduler)
setMonitorInterval
public void setMonitorInterval(long monitorInterval)
setConcurrentConsumers
public void setConcurrentConsumers(int concurrentConsumers)
setMaxConcurrentConsumers
public void setMaxConcurrentConsumers(int maxConcurrentConsumers)
setStartConsumerMinInterval
public void setStartConsumerMinInterval(long startConsumerMinInterval)
setStopConsumerMinInterval
public void setStopConsumerMinInterval(long stopConsumerMinInterval)
setConsecutiveActiveTrigger
public void setConsecutiveActiveTrigger(int consecutiveActiveTrigger)
setConsecutiveIdleTrigger
public void setConsecutiveIdleTrigger(int consecutiveIdleTrigger)
setReceiveTimeout
public void setReceiveTimeout(long receiveTimeout)
setBatchSize
public void setBatchSize(int batchSize)
このプロパティにはいくつかの機能があります。チャネルが処理されると、1 つのトランザクションで処理するメッセージの数が決定されます。
the prefetch count
以下である必要があります。また、
AcknowledgeMode.AUTO
を使用する場合に ACK が送信される頻度にも影響します (BatchSize ごとに 1 つの ACK)。最後に、
setConsumerBatchEnabled(boolean)
が true の場合、setReceiveTimeout(long)
内に十分なメッセージが到着する限り、バッチに含めるレコードの数を決定します。重要バッチサイズは、受信した物理メッセージの数を表します。
setDeBatchingEnabled(boolean)
が true で、メッセージがプロデューサーによって作成されたバッチである場合、リスナーによって受信される実際のメッセージ数は、このバッチサイズよりも大きくなります。デフォルトは 1 です。
- パラメーター:
batchSize
- バッチサイズ- 導入:
- 2.2
setConsumerBatchEnabled
public void setConsumerBatchEnabled(boolean consumerBatchEnabled)
コンテナーとリスナーがサポートしている場合、setBatchSize(int)
に基づいてメッセージのリストを表示するには、true に設定します。- パラメーター:
consumerBatchEnabled
- コンテナーにメッセージバッチを作成する場合は true。- 導入:
- 2.2
- 関連事項:
setBatchSize(int)
setDeclarationRetries
public void setDeclarationRetries(int declarationRetries)
setRetryDeclarationInterval
public void setRetryDeclarationInterval(long retryDeclarationInterval)
getObjectType
public ClassSE<?> getObjectType()
- 次で指定:
- インターフェース
FactoryBean<AbstractMessageListenerContainer>
のgetObjectType
- 次で指定:
- クラス
AbstractFactoryBean<AbstractMessageListenerContainer>
のgetObjectType
createInstance
protected AbstractMessageListenerContainer createInstance()
getPhase
public int getPhase()
- 次で指定:
- インターフェース
Phased
のgetPhase
- 次で指定:
- インターフェース
SmartLifecycle
のgetPhase
isAutoStartup
public boolean isAutoStartup()
- 次で指定:
- インターフェース
SmartLifecycle
のisAutoStartup
stop
public void stop(RunnableSE callback)
- 次で指定:
- インターフェース
SmartLifecycle
のstop