インターフェース 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
- 関連事項:
メソッドのサマリー
修飾子と型メソッド説明void
configure
(IntegrationFlowDefinition<?> flow) EIP メソッドのチェーンを宣言して、提供されたIntegrationFlowDefinition
との統合フローを構成するためのコールバックベースの関数。static IntegrationFlowBuilder
MessageChannel
を新しいIntegrationFlowBuilder
チェーンに入力します。これは、提供されたサービスインターフェース上に構築されたメッセージングゲートウェイのrequestChannel
になります。static IntegrationFlowBuilder
from
(ClassSE<?> serviceInterface, ConsumerSE<GatewayProxySpec> endpointConfigurer) MessageChannel
を新しいIntegrationFlowBuilder
チェーンに入力します。これは、提供されたサービスインターフェース上に構築されたメッセージングゲートウェイのrequestChannel
になります。static IntegrationFlowBuilder
MessageChannel
名を新しいIntegrationFlowBuilder
チェーンに入力します。static IntegrationFlowBuilder
MessageChannel
名を新しいIntegrationFlowBuilder
チェーンに入力します。static IntegrationFlowBuilder
static IntegrationFlowBuilder
from
(MessageSource<?> messageSource) 提供されたMessageSource
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessageSource<?> messageSource, ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSource
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(IntegrationFlow other) IntegrationFlow
のコンポジションでフローを開始します。static IntegrationFlowBuilder
from
(MessageChannelSpec<?, ?> messageChannelSpec) static IntegrationFlowBuilder
from
(MessageProducerSpec<?, ?> messageProducerSpec) MessageProducerSpec
からの流れるような API を使用して、MessageProducerSupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec) 提供されたMessageSourceSpec
からの流れるような API を使用して、MessageSource
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec, ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSourceSpec
からの流れるような API を使用して、MessageSource
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessagingGatewaySpec<?, ?> inboundGatewaySpec) MessagingGatewaySpec
からの流れるような API を使用して、MessagingGatewaySupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessageProducerSupport messageProducer) 提供されたMessageProducerSupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessagingGatewaySupport inboundGateway) 提供されたMessagingGatewaySupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static IntegrationFlowBuilder
from
(MessageChannel messageChannel) 提供されたMessageChannel
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。static <T> IntegrationFlowBuilder
fromSupplier
(SupplierSE<T> messageSource) アプリケーションコンテキストのデフォルトのポーラー(宣言する必要があります)によってトリガーされる統合フローへのメッセージのソースとしてSupplier
SE を提供します。static <T> IntegrationFlowBuilder
fromSupplier
(SupplierSE<T> messageSource, ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 統合フローへのメッセージのソースとしてSupplier
SE を提供します。default MessageChannel
基本的にフロー入力チャネルである最初のMessageChannel
コンポーネントを返します。このフローによって管理される統合コンポーネントのマップを返します(存在する場合)。
メソッドの詳細
configure
EIP メソッドのチェーンを宣言して、提供されたIntegrationFlowDefinition
との統合フローを構成するためのコールバックベースの関数。- パラメーター:
flow
- 構成するIntegrationFlowDefinition
getInputChannel
基本的にフロー入力チャネルである最初のMessageChannel
コンポーネントを返します。- 戻り値:
- チャンネル。
- 導入:
- 5.0.4
getIntegrationComponents
from
- パラメーター:
messageChannelName
- 既存のMessageChannel
Bean の名前。この名前の Bean がない場合、新しいDirectChannel
Bean はコンテキストの起動時に作成されます。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
from
MessageChannelSpec
の流れるような API を使用して、MessageChannel
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
inputChannel
。- パラメーター:
messageChannelSpec
- MessageChannelSpec を使用してMessageChannel
インスタンスを作成します。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
from
MessageChannel
名を新しいIntegrationFlowBuilder
チェーンに入力します。通常、FixedSubscriberChannel
とfixedSubscriber = true
の場合。IntegrationFlow
inputChannel
.- パラメーター:
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
チェーンに移入します。IntegrationFlow
startMessageSource
。- パラメーター:
messageSourceSpec
- 使用するMessageSourceSpec
。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
from
static IntegrationFlowBuilder from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSourceSpec
からの流れるような API を使用して、MessageSource
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
startMessageSource
。- パラメーター:
messageSourceSpec
- 使用するMessageSourceSpec
。endpointConfigurer
-Consumer
SE は、SourcePollingChannelAdapterFactoryBean
により多くのオプションを提供します。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
fromSupplier
アプリケーションコンテキストのデフォルトのポーラー(宣言する必要があります)によってトリガーされる統合フローへのメッセージのソースとしてSupplier
SE を提供します。- 型パラメーター:
T
- サプライヤー型。- パラメーター:
messageSource
- 投入するSupplier
SE- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
fromSupplier
static <T> IntegrationFlowBuilder fromSupplier(SupplierSE<T> messageSource, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 統合フローへのメッセージのソースとしてSupplier
SE を提供します。これは、 提供されたSourcePollingChannelAdapter
によってトリガーされます。- 型パラメーター:
T
- サプライヤー型。- パラメーター:
messageSource
- 投入するSupplier
SEendpointConfigurer
-Consumer
SE は、SourcePollingChannelAdapterFactoryBean
により多くのオプションを提供します。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
from
- パラメーター:
messageSource
- 投入するMessageSource
- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
from
static IntegrationFlowBuilder from(MessageSource<?> messageSource, @Nullable ConsumerSE<SourcePollingChannelAdapterSpec> endpointConfigurer) 提供されたMessageSource
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
startMessageSource
。さらに、SourcePollingChannelAdapterSpec
を使用して、基礎となるSourcePollingChannelAdapter
エンドポイントのオプションを提供します。- パラメーター:
messageSource
- 投入するMessageSource
endpointConfigurer
-Consumer
SE は、SourcePollingChannelAdapterFactoryBean
により多くのオプションを提供します。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
from
MessageProducerSpec
からの流れるような API を使用して、MessageProducerSupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
startMessageProducer
。- パラメーター:
messageProducerSpec
- 使用するMessageProducerSpec
。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
- 関連事項:
from
提供されたMessageProducerSupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
startMessageProducer
。- パラメーター:
messageProducer
- 投入するMessageProducerSupport
- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
from
MessagingGatewaySpec
からの流れるような API を使用して、MessagingGatewaySupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
startMessagingGateway
。- パラメーター:
inboundGatewaySpec
- 使用するMessagingGatewaySpec
。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
from
提供されたMessagingGatewaySupport
オブジェクトをIntegrationFlowBuilder
チェーンに移入します。IntegrationFlow
startMessageProducer
。- パラメーター:
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 は、提供された
Consumer
SE を介して構成されたオプションに基づいています。- パラメーター:
serviceInterface
- オプションのMessagingGateway
アノテーション付きのサービスインターフェースクラス。endpointConfigurer
- ゲートウェイのプロキシ Bean を構成するためのConsumer
SE。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
from
- パラメーター:
publisher
- サブスクライブするPublisher
。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0
from
IntegrationFlow
のコンポジションでフローを開始します。- パラメーター:
other
- 作成元のIntegrationFlow
。- 戻り値:
- 新しい
IntegrationFlowBuilder
。 - 導入:
- 6.0