クラス IdempotentReceiverInterceptor
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.advice.AbstractHandleMessageAdvice
org.springframework.integration.handler.advice.IdempotentReceiverInterceptor
- 実装済みのインターフェース一覧:
Advice, Interceptor, MethodInterceptor, Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ComponentSourceAware, ExpressionCapable, HandleMessageAdvice, NamedComponent
べき等レシーバー E.I。の
MethodInterceptor 実装パターン。 この MethodInterceptor は、discardChannel が指定されているか、throwExceptionOnRejection が true に設定されている場合、MessageFilter のように動作します。ただし、これらのプロパティが指定されていない場合、このインターセプターは requestMessage が MessageSelector によって受け入れられない場合、IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGE ヘッダーを持つ新しい Message を作成します。
idempotent filtering ロジックは、提供されている MessageSelector に依存します。
このクラスは、MessageHandler.handleMessage(Message) メソッド専用に設計されています。
- 導入:
- 4.1
- 作成者:
- Artem Bilan, Gary Russell
- 関連事項:
フィールド概要
クラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明protected @Nullable ObjectSEdoInvoke(MethodInvocation invocation, Message<?> message) voidsetDiscardChannel(MessageChannel discardChannel) 拒否されたメッセージを送信するチャネルを指定します。voidsetDiscardChannelName(StringSE discardChannelName) 拒否されたメッセージを送信するチャネル名を指定します。voidsetThrowExceptionOnRejection(boolean throwExceptionOnRejection) セレクターがメッセージを受け入れないときに、このインターセプターがMessageRejectedExceptionをスローするかどうかを指定します。voidsetTimeout(long timeout) 廃棄チャネルに送信するためのタイムアウト値を指定します。クラス AbstractHandleMessageAdvice から継承されたメソッド
invokeクラス IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
コンストラクターの詳細
IdempotentReceiverInterceptor
方法の詳細
setTimeout
public void setTimeout(long timeout) 廃棄チャネルに送信するためのタイムアウト値を指定します。- パラメーター:
timeout- ミリ秒単位のタイムアウト
setThrowExceptionOnRejection
public void setThrowExceptionOnRejection(boolean throwExceptionOnRejection) このインターセプターがセレクターがメッセージを受け入れない場合に、MessageRejectedExceptionをスローするかどうかを指定します。デフォルト値はfalseです。これは、拒否されたメッセージは破棄されるか、IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGEヘッダーが追加され、通常通りinvocation.proceed()に返されることを意味します。通常、破棄チャネルが提供されている場合、この値はtrueにはなりませんが、提供されている場合は、メッセージが破棄チャネルに送信された後に例外がスローされます。- パラメーター:
throwExceptionOnRejection- 例外をスローする必要がある場合は true。- 関連事項:
setDiscardChannel
拒否されたメッセージを送信するチャネルを指定します。破棄チャネルが null(デフォルト)の場合、重複するメッセージはIntegrationMessageHeaderAccessor.DUPLICATE_MESSAGEヘッダーで強化され、通常どおりinvocation.proceed()に返されます。ただし、"throwExceptionOnRejection" フラグは、拒否されたメッセージが例外をトリガーするかどうかを決定します。その値は、廃棄チャネルの存在に関係なく評価されます。拒否されたメッセージを確認なしで「ドロップ」する必要がある場合は、
discardChannelをnullChannelに構成します。- パラメーター:
discardChannel- 廃棄チャネル。- 関連事項:
setDiscardChannelName
拒否されたメッセージを送信するチャネル名を指定します。破棄チャネルが null(デフォルト)の場合、重複するメッセージはIntegrationMessageHeaderAccessor.DUPLICATE_MESSAGEヘッダーで強化され、通常どおりinvocation.proceed()に返されます。ただし、"throwExceptionOnRejection" フラグは、拒否されたメッセージが例外をトリガーするかどうかを決定します。その値は、廃棄チャネルの存在に関係なく評価されます。拒否されたメッセージを確認なしで「ドロップ」する必要がある場合は、
discardChannelをnullChannelに構成します。discardChannelが提供されていない場合にのみ適用されます。- パラメーター:
discardChannelName- 廃棄チャネル名。- 導入:
- 5.0.1
- 関連事項:
getComponentType
doInvoke
protected @Nullable ObjectSE doInvoke(MethodInvocation invocation, Message<?> message) throws ThrowableSE - 次で指定:
- クラス
AbstractHandleMessageAdviceのdoInvoke - 例外:
ThrowableSE