クラス FluxAggregatorMessageHandler
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.aggregator.FluxAggregatorMessageHandler
- 実装されたすべてのインターフェース:
org.reactivestreams.Subscriber<Message<?>>
、Aware
、BeanFactoryAware
、BeanNameAware
、DisposableBean
、InitializingBean
、ApplicationContextAware
、Lifecycle
、Ordered
、ComponentSourceAware
、ExpressionCapable
、Orderable
、MessageProducer
、HeaderPropagationAware
、IntegrationPattern
、NamedComponent
、IntegrationManagement
、ManageableLifecycle
、TrackableComponent
、MessageHandler
、reactor.core.CoreSubscriber<Message<?>>
public class FluxAggregatorMessageHandler
extends AbstractMessageProducingHandler
implements ManageableLifecycle
Reactor の
Flux.groupBy(java.util.function.Function<? super T, ? extends K>)
および Flux.window(int)
演算子に基づく集約ロジックの AbstractMessageProducingHandler
実装。 受信メッセージは、コンストラクターで初期化された Flux.create(java.util.function.Consumer<? super reactor.core.publisher.FluxSink<T>>)
によって提供される FluxSink
に送信されます。
グループの結果のウィンドウは、ダウンストリーム消費のために Message
にラップされます。
AbstractMessageProducingHandler.getOutputChannel()
が ReactiveStreamsSubscribableChannel
インスタンスでない場合は、集約 Flux
全体のサブスクリプションが start()
メソッドで実行されます。
- 導入:
- 5.2
- 作成者:
- Artem Bilan
ネストされたクラスのサマリー
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドのサマリー
クラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたフィールド
messagingTemplate
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
インターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターの概要
コンストラクターコンストラクター説明Flux.create(java.util.function.Consumer<? super reactor.core.publisher.FluxSink<T>>)
でインスタンスを作成し、それにFlux.groupBy(java.util.function.Function<? super T, ? extends K>)
およびFlux.window(int)
変換を適用します。メソッドのサマリー
修飾子と型メソッド説明サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。このコンポーネントが実装するパターン型を返します。protected void
handleMessageInternal
(Message<?> message) boolean
void
setBoundaryTrigger
(PredicateSE<Message<?>> boundaryTrigger) メッセージのPredicate
SE を構成して、Flux.windowUntil(java.util.function.Predicate<T>)
オペレーターのウィンドウ境界を決定します。void
setCombineFunction
(FunctionSE<reactor.core.publisher.Flux<Message<?>>, reactor.core.publisher.Mono<Message<?>>> combineFunction) 放出するFlux
ウィンドウに適用する変換Function
SE を構成します。void
setCorrelationStrategy
(CorrelationStrategy correlationStrategy) 受信メッセージからグループキーを決定するようにCorrelationStrategy
を構成します。void
setWindowConfigurer
(FunctionSE<reactor.core.publisher.Flux<Message<?>>, reactor.core.publisher.Flux<reactor.core.publisher.Flux<Message<?>>>> windowConfigurer) void
setWindowSize
(int windowSize) 閉じるウィンドウのサイズを指定します。void
setWindowSizeFunction
(FunctionSE<Message<?>, IntegerSE> windowSizeFunction) Function
SE を指定して、グループ内の最初のメッセージに対して閉じるウィンドウのサイズを決定します。void
setWindowTimespan
(DurationSE windowTimespan) ウィンドウを定期的に閉じるようにDuration
SE を構成します。protected boolean
サブクラスはこれをオーバーライドできます。void
start()
void
stop()
クラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたメソッド
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, onInit, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldSplitOutput, updateNotPropagatedHeaders
クラス org.springframework.integration.handler.AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConvention
クラス org.springframework.integration.handler.MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContext
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAs
インターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
コンストラクターの詳細
FluxAggregatorMessageHandler
public FluxAggregatorMessageHandler()Flux.create(java.util.function.Consumer<? super reactor.core.publisher.FluxSink<T>>)
でインスタンスを作成し、それにFlux.groupBy(java.util.function.Function<? super T, ? extends K>)
およびFlux.window(int)
変換を適用します。
メソッドの詳細
setCorrelationStrategy
受信メッセージからグループキーを決定するようにCorrelationStrategy
を構成します。デフォルトでは、IntegrationMessageHeaderAccessor.CORRELATION_ID
ヘッダー値に対してHeaderAttributeCorrelationStrategy
が使用されます。- パラメーター:
correlationStrategy
- 使用するCorrelationStrategy
。
setCombineFunction
public void setCombineFunction(FunctionSE<reactor.core.publisher.Flux<Message<?>>, reactor.core.publisher.Mono<Message<?>>> combineFunction) 放出するFlux
ウィンドウに適用する変換Function
SE を構成します。ウィンドウの受信Flux
の組み合わせ結果として、Message
を値として持つMono
結果が必要です。デフォルトでは、ウィンドウのFlux
は、ウィンドウの最初のメッセージからコピーされたヘッダーを持つメッセージに完全にラップされます。ペイロード内のこのようなFlux
は、サブスクライブしてダウンストリームで使用する必要があります。- パラメーター:
combineFunction
- 結果ウィンドウの変換に使用するFunction
SE
setBoundaryTrigger
メッセージのPredicate
SE を構成して、Flux.windowUntil(java.util.function.Predicate<T>)
オペレーターのウィンドウ境界を決定します。他のウィンドウ構成オプションよりも優先されます。- パラメーター:
boundaryTrigger
- ウィンドウ境界に使用するPredicate
SE- 関連事項:
setWindowSize
public void setWindowSize(int windowSize) 閉じるウィンドウのサイズを指定します。setWindowTimespan(Duration)
と組み合わせることができます。- パラメーター:
windowSize
- 使用するウィンドウのサイズ。- 関連事項:
setWindowSizeFunction
Function
SE を指定して、グループ内の最初のメッセージに対して閉じるウィンドウのサイズを決定します。関数の結果はsetWindowTimespan(Duration)
と組み合わせることができます。デフォルトでは、IntegrationMessageHeaderAccessor.SEQUENCE_SIZE
ヘッダーが参照されます。- パラメーター:
windowSizeFunction
- グループ内の最初のメッセージに対してウィンドウサイズを決定するために使用するFunction
SE。- 関連事項:
setWindowTimespan
ウィンドウを定期的に閉じるようにDuration
SE を構成します。setWindowSize(int)
またはsetWindowSizeFunction(Function)
と組み合わせることができます。- パラメーター:
windowTimespan
- ウィンドウを定期的に閉じるために使用するDuration
SE。- 関連事項:
setWindowConfigurer
public void setWindowConfigurer(FunctionSE<reactor.core.publisher.Flux<Message<?>>, reactor.core.publisher.Flux<reactor.core.publisher.Flux<Message<?>>>> windowConfigurer) 単純なオプションではカバーされない任意のFlux.window(int)
オプションのグループ化Flux
に変換を適用するようにFunction
SE を構成します。他のウィンドウ構成オプションよりも優先されます。- パラメーター:
windowConfigurer
-Function
SE を使用して、カスタムウィンドウ変換を適用します。
getComponentType
クラスからコピーされた説明:IntegrationObjectSupport
サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。- 次で指定:
- インターフェース
NamedComponent
のgetComponentType
- オーバーライド:
- クラス
MessageHandlerSupport
のgetComponentType
getIntegrationPatternType
インターフェースからコピーされた説明:IntegrationPattern
このコンポーネントが実装するパターン型を返します。- 次で指定:
- インターフェース
IntegrationPattern
のgetIntegrationPatternType
- オーバーライド:
- クラス
MessageHandlerSupport
のgetIntegrationPatternType
- 戻り値:
- このコンポーネントが実装する
IntegrationPatternType
start
public void start()- 次で指定:
- インターフェース
Lifecycle
のstart
- 次で指定:
- インターフェース
ManageableLifecycle
のstart
stop
public void stop()- 次で指定:
- インターフェース
Lifecycle
のstop
- 次で指定:
- インターフェース
ManageableLifecycle
のstop
isRunning
public boolean isRunning()- 次で指定:
- インターフェース
Lifecycle
のisRunning
- 次で指定:
- インターフェース
ManageableLifecycle
のisRunning
handleMessageInternal
- 次で指定:
- クラス
AbstractMessageHandler
のhandleMessageInternal
shouldCopyRequestHeaders
protected boolean shouldCopyRequestHeaders()クラスからコピーされた説明:AbstractMessageProducingHandler
サブクラスはこれをオーバーライドできます。デフォルトでは true。- オーバーライド:
- クラス
AbstractMessageProducingHandler
のshouldCopyRequestHeaders
- 戻り値:
- リクエストヘッダーをコピーする必要がある場合は true。