@ManagedResource @IntegrationManagedResource public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport implements ApplicationEventPublisherAware, BeanClassLoaderAware
| 修飾子と型 | フィールドと説明 |
|---|---|
static long | DEFAULT_RECEIVE_TIMEOUT |
static long | DEFAULT_RECOVERY_INTERVAL |
lifecycleCondition, lifecycleLockEXPRESSION_PARSER, loggerDEFAULT_PHASE| コンストラクターと説明 |
|---|
RedisQueueMessageDrivenEndpoint(StringSE queueName, RedisConnectionFactory connectionFactory) |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | clearQueue()boundListOperations で指定された Redis キューをクリアします。 |
protected void | doStart() デフォルトでは何もしません。 |
protected void | doStop() デフォルトでは何もしません。 |
protected void | doStop(RunnableSE callback) コンポーネントを停止し、コールバックを呼び出します。 |
StringSE | getComponentType() サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。 |
long | getQueueSize()boundListOperations で指定されたキューのサイズを返します。 |
boolean | isListening() |
protected void | onInit() サブクラスは、初期化ロジック用にこれを実装できます。 |
void | setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void | setBeanClassLoader(ClassLoaderSE beanClassLoader) |
void | setExpectMessage(boolean expectMessage) データが Redis キューから取得されるとき、返されるデータはメッセージのペイロードのみを表しますか、それともデータは直列化された Message を表しますか? |
void | setReceiveTimeout(long receiveTimeout) このタイムアウト(ミリ秒)は、 boundListOperations で指定されたキューから要素を取得するときに使用されます。 |
void | setRecoveryInterval(long recoveryInterval) |
void | setRightPop(boolean rightPop)Redis リストからの POP 操作を BRPOP または BLPOP にするかどうかを指定します。 |
void | setSerializer(RedisSerializer<?> serializer) |
void | setTaskExecutor(ExecutorSE taskExecutor) |
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisherdestroy, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopafterPropertiesSet, 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, toStringcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEgetBeanName, getComponentNamepublic static final long DEFAULT_RECEIVE_TIMEOUT
public static final long DEFAULT_RECOVERY_INTERVAL
public RedisQueueMessageDrivenEndpoint(StringSE queueName, RedisConnectionFactory connectionFactory)
queueName - 空の文字列であってはなりません connectionFactory - null であってはなりません public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
ApplicationEventPublisherAware の setApplicationEventPublisher public void setBeanClassLoader(ClassLoaderSE beanClassLoader)
BeanClassLoaderAware の setBeanClassLoader public void setSerializer(RedisSerializer<?> serializer)
public void setExpectMessage(boolean expectMessage)
Message を表しますか? expectMessage のデフォルトは false です。これは、取得したデータが新しい Spring Integration メッセージのペイロードとして使用されることを意味します。それ以外の場合、データは Spring Integration メッセージとして逆直列化されます。expectMessage - デフォルトは false です public void setReceiveTimeout(long receiveTimeout)
boundListOperations で指定されたキューから要素を取得するときに使用されます。キューに要素が含まれている場合、データはすぐに取得されます。ただし、キューが空の場合、要素をキューから取得できるか、指定されたタイムアウトが経過するまで、Redis 接続はブロックされます。
ゼロのタイムアウトは、無期限にブロックするために使用できます。明示的に設定されていない場合、タイムアウト値はデフォルトで 1000 になります
関連事項: https://redis.io/commands/brpop
receiveTimeout - 負でない必要があります。ミリ秒で指定されます。public void setTaskExecutor(ExecutorSE taskExecutor)
public void setRecoveryInterval(long recoveryInterval)
public void setRightPop(boolean rightPop)
POP 操作を BRPOP または BLPOP にするかどうかを指定します。rightPop - BRPOP フラグ。デフォルトは true です。protected void onInit()
IntegrationObjectSupportMessageProducerSupport の onInit public StringSE getComponentType()
IntegrationObjectSupportNamedComponent の getComponentType IntegrationObjectSupport の getComponentType protected void doStart()
MessageProducerSupportMessageProducerSupport の doStart protected void doStop(RunnableSE callback)
AbstractEndpointAbstractEndpoint の doStop callback - 起動する Runnable。protected void doStop()
MessageProducerSupportMessageProducerSupport の doStop public boolean isListening()
@ManagedMetric public long getQueueSize()
boundListOperations で指定されたキューのサイズを返します。キューは Redis リストで表されます。キューが存在しない場合、0 が返されます。https://redis.io/commands/llen も参照してください @ManagedOperation public void clearQueue()
boundListOperations で指定された Redis キューをクリアします。