クラス RedisQueueInboundGateway
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.redis.inbound.RedisQueueInboundGateway
- 実装されているすべてのインターフェース:
Aware、BeanClassLoaderAware、BeanFactoryAware、BeanNameAware、DisposableBean、InitializingBean、ApplicationContextAware、ApplicationEventPublisherAware、Lifecycle、Phased、SmartLifecycle、ExpressionCapable、IntegrationPattern、NamedComponent、IntegrationInboundManagement、IntegrationManagement、ManageableLifecycle、ManageableSmartLifecycle、TrackableComponent
@ManagedResource @IntegrationManagedResource public class RedisQueueInboundGateway extends MessagingGatewaySupport implements ApplicationEventPublisherAware, BeanClassLoaderAware
- 導入:
- 4.1
- 作成者:
- David Liu, Artem Bilan, Gary Russell, Matthias Jeschke
ネストされたクラスの要約
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールドのサマリー
フィールド 修飾子と型 フィールド 説明 static longDEFAULT_RECEIVE_TIMEOUTstatic longDEFAULT_RECOVERY_INTERVALクラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたフィールド
lifecycleCondition, lifecycleLockクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEコンストラクターの概要
コンストラクター コンストラクター 説明 RedisQueueInboundGateway(StringSE queueName, RedisConnectionFactory connectionFactory)メソッドのサマリー
修飾子と型 メソッド 説明 voidclearQueue()boundListOperationsで指定された Redis キューをクリアします。protected voiddoStart()サブクラスは、開始動作でこのメソッドを実装する必要があります。protected voiddoStop()サブクラスは、停止動作でこのメソッドを実装する必要があります。protected voiddoStop(RunnableSE callback)コンポーネントを停止し、コールバックを呼び出します。StringSEgetComponentType()サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。longgetQueueSize()boundListOperationsで指定されたキューのサイズを返します。booleanisListening()protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)voidsetBeanClassLoader(ClassLoaderSE beanClassLoader)voidsetExtractPayload(boolean extractPayload)voidsetReceiveTimeout(long receiveTimeout)このタイムアウト(ミリ秒)は、boundListOperationsで指定されたキューから要素を取得するときに使用されます。voidsetRecoveryInterval(long recoveryInterval)voidsetSerializer(RedisSerializer<?> serializer)voidsetTaskExecutor(ExecutorSE taskExecutor)クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたメソッド
buildErrorMessage, buildSendTimer, destroy, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackクラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたメソッド
getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAsインターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
フィールドの詳細
DEFAULT_RECEIVE_TIMEOUT
public static final long DEFAULT_RECEIVE_TIMEOUT- 関連事項:
- 定数フィールド値
DEFAULT_RECOVERY_INTERVAL
public static final long DEFAULT_RECOVERY_INTERVAL- 関連事項:
- 定数フィールド値
コンストラクターの詳細
RedisQueueInboundGateway
- パラメーター:
queueName- 空の文字列であってはなりませんconnectionFactory- null であってはなりません
メソッドの詳細
setExtractPayload
public void setExtractPayload(boolean extractPayload)setApplicationEventPublisher
- 次で指定:
- インターフェース
ApplicationEventPublisherAwareのsetApplicationEventPublisher
setBeanClassLoader
- 次で指定:
- インターフェース
BeanClassLoaderAwareのsetBeanClassLoader
setSerializer
setReceiveTimeout
public void setReceiveTimeout(long receiveTimeout)このタイムアウト(ミリ秒)は、boundListOperationsで指定されたキューから要素を取得するときに使用されます。キューに要素が含まれている場合、データはすぐに取得されます。ただし、キューが空の場合、要素をキューから取得できるか、指定されたタイムアウトが経過するまで、Redis 接続はブロックされます。
ゼロのタイムアウトは、無期限にブロックするために使用できます。明示的に設定されていない場合、タイムアウト値はデフォルトで
1000になります関連事項: https://redis.io/commands/brpop
- パラメーター:
receiveTimeout- 負でない必要があります。ミリ秒で指定されます。
setTaskExecutor
setRecoveryInterval
public void setRecoveryInterval(long recoveryInterval)onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
MessagingGatewaySupportのonInit
getComponentType
クラスからコピーされた説明:IntegrationObjectSupportサブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。- 次で指定:
- インターフェース
NamedComponentのgetComponentType - オーバーライド:
- クラス
MessagingGatewaySupportのgetComponentType
doStart
protected void doStart()クラスからコピーされた説明:AbstractEndpointサブクラスは、開始動作でこのメソッドを実装する必要があります。このメソッドは、AbstractEndpoint.lifecycleLockを保持しているときに呼び出されます。- オーバーライド:
- クラス
MessagingGatewaySupportのdoStart
doStop
クラスからコピーされた説明:AbstractEndpointコンポーネントを停止し、コールバックを呼び出します。- オーバーライド:
- クラス
AbstractEndpointのdoStop - パラメーター:
callback- 起動する Runnable。
doStop
protected void doStop()クラスからコピーされた説明:AbstractEndpointサブクラスは、停止動作でこのメソッドを実装する必要があります。このメソッドは、AbstractEndpoint.lifecycleLockを保持しているときに呼び出されます。- オーバーライド:
- クラス
MessagingGatewaySupportのdoStop
isListening
public boolean isListening()getQueueSize
boundListOperationsで指定されたキューのサイズを返します。キューは Redis リストで表されます。キューが存在しない場合は、0が返されます。https://redis.io/commands/llen も参照してください- 戻り値:
- キューのサイズ。決して否定的ではありません。
clearQueue
boundListOperationsで指定された Redis キューをクリアします。