クラス PartitionedChannel
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.channel.AbstractSubscribableChannel
org.springframework.integration.channel.AbstractExecutorChannel
org.springframework.integration.channel.PartitionedChannel
- 実装済みのインターフェース一覧:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ExecutorChannelInterceptorAware, ComponentSourceAware, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationManagement, SubscribableChannelManagement, TrackableComponent, MessageChannel, SubscribableChannel, InterceptableChannel
パーティション化されたメッセージディスパッチのための
AbstractExecutorChannel 実装。複数のパーティションが必要で、各パーティションは専用のスレッドによってサポートされます。partitionKeyFunction は、メッセージをどのパーティションにディスパッチするかを決定するために使用されます。デフォルトでは、IntegrationMessageHeaderAccessor.CORRELATION_ID メッセージヘッダーがパーティションキーとして使用されます。 実際のディスパッチおよびスレッド化ロジックは PartitionedDispatcher に実装されています。
デフォルトの ThreadFactorySE は、このチャネルの Bean 名に -partition-thread- を加えたものに基づいています。すべてのスレッド名は、それが属するパーティションを反映します。
ロジックの残りの部分は ExecutorChannel と似ており、次のものが含まれます。- サブスクライバのロードバランシング。- フェイルオーバーとエラー処理。- チャネル操作のインターセプト。
- 導入:
- 6.1
- 作成者:
- Artem Bilan
- 関連事項:
ネストされたクラスの概要
クラス AbstractExecutorChannel から継承されたネストクラス / インターフェース
AbstractExecutorChannel.MessageHandlingTaskクラス AbstractMessageChannel から継承されたネストクラス / インターフェース
AbstractMessageChannel.ChannelInterceptorListインターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
クラス AbstractExecutorChannel から継承されたフィールド
dispatcher, executor, executorInterceptorsSize, maxSubscribersクラス AbstractMessageChannel から継承されたフィールド
interceptors, metersクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース MessageChannel から継承されたフィールド
INDEFINITE_TIMEOUTコンストラクター概要
コンストラクターコンストラクター説明PartitionedChannel(int partitionCount) 指定されたパーティション数に基づいてインスタンスを作成し、IntegrationMessageHeaderAccessor.CORRELATION_IDメッセージヘッダーからパーティションキーを解決します。PartitionedChannel(int partitionCount, FunctionSE<Message<?>, ObjectSE> partitionKeyFunction) 指定されたパーティション数と、メッセージに対するパーティションキーの機能に基づいてインスタンスを作成します。方法の概要
修飾子と型メソッド説明voiddestroy()protected PartitionedDispatcherprotected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidsetFailover(boolean failover) チャネルのディスパッチャーでフェイルオーバーを有効にするかどうかを指定します。voidsetFailoverStrategy(PredicateSE<ExceptionSE> failoverStrategy) スローされた例外に対してチャネルのディスパッチャーでフェイルオーバーを有効にするかどうかの戦略を構成します。voidsetLoadBalancingStrategy(@Nullable LoadBalancingStrategy loadBalancingStrategy) PartitionedDispatcherにはLoadBalancingStrategyを指定します。voidsetThreadFactory(ThreadFactorySE threadFactory) パーティションごとにエグゼキュータのThreadFactorySE を設定します。voidsetWorkerQueueSize(int workerQueueSize) パーティションエグゼキュータの ワーカーにキューのサイズを指定します。クラス AbstractExecutorChannel から継承されたメソッド
addInterceptor, addInterceptor, getIntegrationPatternType, hasExecutorInterceptors, removeInterceptor, removeInterceptor, setInterceptors, setMaxSubscribersクラス AbstractSubscribableChannel から継承されたメソッド
doSend, getSubscriberCount, subscribe, unsubscribeクラス AbstractMessageChannel から継承されたメソッド
getComponentType, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMetricsCaptor, getOverrides, isApplicationRunning, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrackクラス 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クラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース IntegrationManagement から継承されたメソッド
getManagedName, getManagedType, getThisAs, setManagedName, setManagedTypeインターフェース InterceptableChannel から継承されたメソッド
getInterceptorsインターフェース MessageChannel から継承されたメソッド
send, sendインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentName
コンストラクターの詳細
PartitionedChannel
public PartitionedChannel(int partitionCount) 指定されたパーティション数に基づいてインスタンスを作成し、IntegrationMessageHeaderAccessor.CORRELATION_IDメッセージヘッダーからパーティションキーを解決します。- パラメーター:
partitionCount- このチャネルのパーティションの数。
PartitionedChannel
public PartitionedChannel(int partitionCount, FunctionSE<Message<?>, ObjectSE> partitionKeyFunction) 指定されたパーティション数と、メッセージに対するパーティションキーの機能に基づいてインスタンスを作成します。- パラメーター:
partitionCount- このチャネルのパーティションの数。partitionKeyFunction- このチャネルに送信されたメッセージに対してパーティションキーを解決する関数。
方法の詳細
setThreadFactory
パーティションごとにエグゼキュータのThreadFactorySE を設定します。PartitionedDispatcherまで伝播します。デフォルトは、このチャネルの Bean 名に-partition-thread-を加えたCustomizableThreadFactoryになります。- パラメーター:
threadFactory- 使用するThreadFactorySE。
setFailover
public void setFailover(boolean failover) チャネルのディスパッチャーでフェイルオーバーを有効にするかどうかを指定します。デフォルトではそうなります。無効にするには、この値を "false" に設定します。- パラメーター:
failover- フェールオーバーブール値。
setFailoverStrategy
スローされた例外に対してチャネルのディスパッチャーがフェイルオーバーを有効にするかどうかの戦略を構成します。setFailover(boolean)オプションをオーバーライドします。つまり、このオプションまたはそのオプションを設定する必要があります。- パラメーター:
failoverStrategy- フェイルオーバー戦略述語。- 導入:
- 6.3
setLoadBalancingStrategy
PartitionedDispatcherにはLoadBalancingStrategyを指定します。- パラメーター:
loadBalancingStrategy- 負荷分散戦略の実装。
setWorkerQueueSize
public void setWorkerQueueSize(int workerQueueSize) パーティションエグゼキュータのワーカーにキューのサイズを指定します。デフォルトは 0 です。- パラメーター:
workerQueueSize- パーティションエグゼキュータの ワーカーキューのサイズ。- 導入:
- 6.4.10
getDispatcher
- 次で指定:
- クラス
AbstractSubscribableChannelのgetDispatcher
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
AbstractMessageChannelのonInit
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean内のdestroy - 次で指定:
- インターフェース
IntegrationManagement内のdestroy - オーバーライド:
- クラス
AbstractMessageChannelのdestroy