インターフェース IntegrationFlow
- すべての既知の実装クラス:
IntegrationFlowAdapter,StandardIntegrationFlow
- 関数インターフェース:
- これは関数インターフェースであるため、ラムダ式またはメソッド参照の割り当てターゲットとして使用できます。
メインの統合 DSL 抽象化。
StandardIntegrationFlow 実装(IntegrationFlowBuilder によって生成される)は、アプリケーションコンテキストに登録される統合コンポーネントのコンテナーを表します。通常、@Bean 定義として使用されます。
@Bean
public IntegrationFlow fileReadingFlow() {
return IntegrationFlow
.from(Files.inboundAdapter(tmpDir.getRoot()), e -> e.poller(Pollers.fixedDelay(100)))
.transform(Files.fileToString())
.channel(MessageChannels.queue("fileReadingResultChannel"))
.get();
}
トップレベル定義およびサブフロー定義のラムダとして使用できます。
@Bean
public IntegrationFlow routerTwoSubFlows() {
return f -> f
.split()
.<Integer, Boolean>route(p -> p % 2 == 0, m -> m
.subFlowMapping(true, sf -> sf.<Integer>handle((p, h) -> p * 2))
.subFlowMapping(false, sf -> sf.<Integer>handle((p, h) -> p * 3)))
.aggregate()
.channel(MessageChannels.queue("routerTwoSubFlowsOutput"));
}
また、このインターフェースを直接実装して、ターゲットサービスの統合ロジックをカプセル化することもできます。
@Component
public class MyFlow implements IntegrationFlow {
@Override
public void configure(IntegrationFlowDefinition<?> f) {
f.<String, String>transform(String::toUpperCase);
}
}
- 導入:
- 5.0
- 作成者:
- Artem Bilan, Gary Russell, Oleg Zhurakousky, Artem Vozhdayenko
- 関連事項:
方法の概要
修飾子と型メソッド説明voidconfigure(IntegrationFlowDefinition<?> flow) EIP メソッドのチェーンを宣言して、提供されたIntegrationFlowDefinitionとの統合フローを構成するためのコールバックベースの関数。static <T> @Nullable TextractProxyTarget(@Nullable T target) static IntegrationFlowBuilderMessageChannelを新しいIntegrationFlowBuilderチェーンに入力します。これは、提供されたサービスインターフェース上に構築されたメッセージングゲートウェイのrequestChannelになります。static IntegrationFlowBuilderfrom(ClassSE<?> serviceInterface, @Nullable ConsumerSE<GatewayProxySpec> endpointConfigurer) MessageChannelを新しいIntegrationFlowBuilderチェーンに入力します。これは、提供されたサービスインターフェース上に構築されたメッセージングゲートウェイのrequestChannelになります。static IntegrationFlowBuilderMessageChannel名を新しいIntegrationFlowBuilderチェーンに入力します。static IntegrationFlowBuilderMessageChannel名を新しいIntegrationFlowBuilderチェーンに入力します。static IntegrationFlowBuilderstatic IntegrationFlowBuilderfrom(MessageSource<?> messageSource) 提供されたMessageSourceオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessageSource<?> messageSource, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSourceオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(IntegrationFlow other) IntegrationFlowのコンポジションでフローを開始します。static IntegrationFlowBuilderfrom(MessageChannelSpec<?, ?> messageChannelSpec) static IntegrationFlowBuilderfrom(MessageProducerSpec<?, ?> messageProducerSpec) MessageProducerSpecからの流れるような API を使用して、MessageProducerSupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec) 提供されたMessageSourceSpecからの流れるような API を使用して、MessageSourceオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSourceSpecからの流れるような API を使用して、MessageSourceオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessagingGatewaySpec<?, ?> inboundGatewaySpec) MessagingGatewaySpecからの流れるような API を使用して、MessagingGatewaySupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessageProducerSupport messageProducer) 提供されたMessageProducerSupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessagingGatewaySupport inboundGateway) 提供されたMessagingGatewaySupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。static IntegrationFlowBuilderfrom(MessageChannel messageChannel) 提供されたMessageChannelオブジェクトをIntegrationFlowBuilderチェーンに移入します。static <T> IntegrationFlowBuilderfromSupplier(SupplierSE<T> messageSource) アプリケーションコンテキストのデフォルトのポーラー(宣言する必要があります)によってトリガーされる統合フローへのメッセージのソースとしてSupplierSE を提供します。static <T> IntegrationFlowBuilderfromSupplier(SupplierSE<T> messageSource, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 統合フローへのメッセージのソースとしてSupplierSE を提供します。default @Nullable MessageChannel基本的にフロー入力チャネルである最初のMessageChannelコンポーネントを返します。このフローによって管理される統合コンポーネントのマップを返します(存在する場合)。
メソッドの詳細
configure
EIP メソッドのチェーンを宣言して、提供されたIntegrationFlowDefinitionとの統合フローを構成するためのコールバックベースの関数。- パラメーター:
flow- 構成するIntegrationFlowDefinition
getInputChannel
基本的にフロー入力チャネルである最初のMessageChannelコンポーネントを返します。- 戻り値:
- チャンネル。
- 導入:
- 5.0.4
getIntegrationComponents
from
- パラメーター:
messageChannelName- 既存のMessageChannelBean の名前。この名前の Bean がない場合、新しいDirectChannelBean はコンテキストの起動時に作成されます。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
MessageChannelSpecの流れるような API を使用して、MessageChannelオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowinputChannel。- パラメーター:
messageChannelSpec- MessageChannelSpec を使用してMessageChannelインスタンスを作成します。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
MessageChannel名を新しいIntegrationFlowBuilderチェーンに入力します。通常、FixedSubscriberChannelとfixedSubscriber = trueの場合。IntegrationFlowinputChannel.- パラメーター:
messageChannelName- 参照ではなく、コンテキストの起動時に作成されるDirectChannelまたはFixedSubscriberChannelの名前。MessageChannelは、fixedSubscriberブール引数に依存します。fixedSubscriber- 結果MessageChannelがDirectChannel(falseの場合)またはFixedSubscriberChannel(trueの場合)であるかどうかを判別するためのブールフラグ。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
- パラメーター:
messageChannel- 投入するMessageChannel- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
static IntegrationFlowBuilder from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec) 提供されたMessageSourceSpecからの流れるような API を使用して、MessageSourceオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowstartMessageSource。- パラメーター:
messageSourceSpec- 使用するMessageSourceSpec。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
static IntegrationFlowBuilder from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSourceSpecからの流れるような API を使用して、MessageSourceオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowstartMessageSource。- パラメーター:
messageSourceSpec- 使用するMessageSourceSpec。endpointConfigurer-ConsumerSE は、SourcePollingChannelAdapterFactoryBeanにより多くのオプションを提供します。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
fromSupplier
アプリケーションコンテキストのデフォルトのポーラー(宣言する必要があります)によってトリガーされる統合フローへのメッセージのソースとしてSupplierSE を提供します。- 型パラメーター:
T- サプライヤー型。- パラメーター:
messageSource- 投入するSupplierSE- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
fromSupplier
static <T> IntegrationFlowBuilder fromSupplier(SupplierSE<T> messageSource, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 統合フローへのメッセージのソースとしてSupplierSE を提供します。これは、 提供されたSourcePollingChannelAdapterによってトリガーされます。- 型パラメーター:
T- サプライヤー型。- パラメーター:
messageSource- 投入するSupplierSEendpointConfigurer-ConsumerSE は、SourcePollingChannelAdapterFactoryBeanにより多くのオプションを提供します。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
- パラメーター:
messageSource- 投入するMessageSource- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
static IntegrationFlowBuilder from(MessageSource<?> messageSource, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSourceオブジェクトをIntegrationFlowBuilderチェーンに入力します。IntegrationFlowstartMessageSource。さらに、SourcePollingChannelAdapterSpecを使用して、基盤となるSourcePollingChannelAdapterエンドポイントのオプションを提供します。- パラメーター:
messageSource- 投入するMessageSourceendpointConfigurer-ConsumerSE は、SourcePollingChannelAdapterFactoryBeanにより多くのオプションを提供します。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
MessageProducerSpecからの流れるような API を使用して、MessageProducerSupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowstartMessageProducer。- パラメーター:
messageProducerSpec- 使用するMessageProducerSpec。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
- 関連事項:
from
提供されたMessageProducerSupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowstartMessageProducer。- パラメーター:
messageProducer- 投入するMessageProducerSupport- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
MessagingGatewaySpecからの流れるような API を使用して、MessagingGatewaySupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowstartMessagingGateway。- パラメーター:
inboundGatewaySpec- 使用するMessagingGatewaySpec。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
提供されたMessagingGatewaySupportオブジェクトをIntegrationFlowBuilderチェーンに移入します。IntegrationFlowstartMessageProducer。- パラメーター:
inboundGateway- 投入するMessagingGatewaySupport- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
MessageChannelを新しいIntegrationFlowBuilderチェーンに入力します。これは、提供されたサービスインターフェース上に構築されたメッセージングゲートウェイのrequestChannelになります。提供されたサービスインターフェースのゲートウェイプロキシ Bean は、存在する場合は
MessagingGateway.name()から、またはIntegrationFlowからの名前で登録されます。Bean 名と.gatewayサフィックス。- パラメーター:
serviceInterface- オプションのMessagingGatewayアノテーション付きのサービスインターフェースクラス。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
static IntegrationFlowBuilder from(ClassSE<?> serviceInterface, @Nullable ConsumerSE<GatewayProxySpec> endpointConfigurer) MessageChannelを新しいIntegrationFlowBuilderチェーンに入力します。これは、提供されたサービスインターフェース上に構築されたメッセージングゲートウェイのrequestChannelになります。提供されたサービスインターフェースのゲートウェイプロキシ Bean は、提供された
ConsumerSE を介して構成されたオプションに基づいています。- パラメーター:
serviceInterface- オプションのMessagingGatewayアノテーション付きのサービスインターフェースクラス。endpointConfigurer- ゲートウェイのプロキシ Bean を構成するためのConsumerSE。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
- パラメーター:
publisher- サブスクライブするPublisher。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
from
IntegrationFlowのコンポジションでフローを開始します。- パラメーター:
other- 作成元のIntegrationFlow。- 戻り値:
- 新しい
IntegrationFlowBuilder。 - 導入:
- 6.0
extractProxyTarget
static <T> @Nullable T extractProxyTarget(@Nullable T target)