public class IdempotentReceiverInterceptor extends AbstractHandleMessageAdvice
MethodInterceptor 実装パターン。 この MethodInterceptor は、discardChannel が提供されているか、throwExceptionOnRejection が true に設定されている場合、MessageFilter のように機能します。ただし、これらのプロパティが提供されていない場合、requestMessage が MessageSelector によって受け入れられない場合、このインターセプターは IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGE ヘッダーを持つ新しい Message を作成します。
idempotent filtering ロジックは、提供されている MessageSelector に依存します。
このクラスは、MessageHandler.handleMessage(org.springframework.messaging.Message<?>) メソッドでのみ使用されるように設計されています。
MetadataStoreSelector, IdempotentReceiverAutoProxyCreatorInitializerEXPRESSION_PARSER, logger| コンストラクターと説明 |
|---|
IdempotentReceiverInterceptor(MessageSelector messageSelector) |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected ObjectSE | doInvoke(MethodInvocation invocation, Message<?> message) |
StringSE | getComponentType() サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。 |
void | setDiscardChannel(MessageChannel discardChannel) 拒否されたメッセージを送信するチャネルを指定します。 |
void | setDiscardChannelName(StringSE discardChannelName) 拒否されたメッセージを送信するチャネル名を指定します。 |
void | setThrowExceptionOnRejection(boolean throwExceptionOnRejection) セレクターがメッセージを受け入れないときに、このインターセプターが MessageRejectedException をスローするかどうかを指定します。 |
void | setTimeout(long timeout) 廃棄チャネルに送信するためのタイムアウト値を指定します。 |
invokeafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEpublic IdempotentReceiverInterceptor(MessageSelector messageSelector)
public void setTimeout(long timeout)
timeout - ミリ秒単位のタイムアウト public void setThrowExceptionOnRejection(boolean throwExceptionOnRejection)
MessageRejectedException をスローするかどうかを指定します。デフォルト値は false です。これは、拒否されたメッセージが破棄されるか、IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGE ヘッダーで強化され、通常どおり invocation.proceed() に返されることを意味します。通常、破棄チャネルが提供されている場合、この値は true ではありませんが、提供されている場合は、メッセージが破棄チャネルに送信された後に例外がスローされます。throwExceptionOnRejection - 例外をスローする必要がある場合は true。setDiscardChannel(MessageChannel)public void setDiscardChannel(MessageChannel discardChannel)
IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGE ヘッダーで強化され、通常どおり invocation.proceed() に返されます。ただし、"throwExceptionOnRejection" フラグは、拒否されたメッセージが例外をトリガーするかどうかを決定します。その値は、廃棄チャネルの存在に関係なく評価されます。 拒否されたメッセージを確認なしで「ドロップ」する必要がある場合は、discardChannel を nullChannel に構成します。
discardChannel - 廃棄チャネル。setThrowExceptionOnRejection(boolean)public void setDiscardChannelName(StringSE discardChannelName)
IntegrationMessageHeaderAccessor.DUPLICATE_MESSAGE ヘッダーで強化され、通常どおり invocation.proceed() に返されます。ただし、"throwExceptionOnRejection" フラグは、拒否されたメッセージが例外をトリガーするかどうかを決定します。その値は、廃棄チャネルの存在に関係なく評価されます。 拒否されたメッセージを確認なしで「ドロップ」する必要がある場合は、discardChannel を nullChannel に構成します。
discardChannel が提供されていない場合にのみ適用されます。
discardChannelName - 廃棄チャネル名。setThrowExceptionOnRejection(boolean)public StringSE getComponentType()
IntegrationObjectSupportNamedComponent の getComponentType IntegrationObjectSupport の getComponentType protected ObjectSE doInvoke(MethodInvocation invocation, Message<?> message) throws ThrowableSE
AbstractHandleMessageAdvice の doInvoke ThrowableSE