クラス 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
、ExpressionCapable
、IntegrationPattern
、NamedComponent
、IntegrationManagement
、SubscribableChannelManagement
、TrackableComponent
、MessageChannel
、SubscribableChannel
、InterceptableChannel
分割されたメッセージディスパッチのための
AbstractExecutorChannel
実装。それぞれが専用のスレッドによってサポートされる多数のパーティションが必要です。partitionKeyFunction
は、メッセージをどのパーティションにディスパッチする必要があるかを決定するために使用されます。デフォルトでは、IntegrationMessageHeaderAccessor.CORRELATION_ID
メッセージヘッダーがパーティションキーに使用されます。 実際のディスパッチおよびスレッド化ロジックは PartitionedDispatcher
に実装されています。
デフォルトの ThreadFactory
SE は、このチャネルの Bean 名に -partition-thread-
を加えたものに基づいています。すべてのスレッド名は、それが属するパーティションを反映します。
ロジックの残りの部分は ExecutorChannel
と似ており、次のものが含まれます。- サブスクライバのロードバランシング。- フェイルオーバーとエラー処理。- チャネル操作のインターセプト。
- 導入:
- 6.1
- 作成者:
- Artem Bilan
- 関連事項:
ネストされたクラスのサマリー
クラス org.springframework.integration.channel.AbstractExecutorChannel から継承されたネストクラス / インターフェース
AbstractExecutorChannel.MessageHandlingTask
クラス org.springframework.integration.channel.AbstractMessageChannel から継承されたネストクラス / インターフェース
AbstractMessageChannel.ChannelInterceptorList
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドサマリー
クラス org.springframework.integration.channel.AbstractExecutorChannel から継承されたフィールド
dispatcher, executor, executorInterceptorsSize, maxSubscribers
クラス org.springframework.integration.channel.AbstractMessageChannel から継承されたフィールド
interceptors, meters
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
インターフェース org.springframework.messaging.MessageChannel から継承されたフィールド
INDEFINITE_TIMEOUT
コンストラクターのサマリー
コンストラクター説明PartitionedChannel
(int partitionCount) 指定されたパーティション数に基づいてインスタンスを作成し、IntegrationMessageHeaderAccessor.CORRELATION_ID
メッセージヘッダーからパーティションキーを解決します。PartitionedChannel
(int partitionCount, FunctionSE<Message<?>, ObjectSE> partitionKeyFunction) 指定されたパーティション数に基づいてインスタンスを作成し、メッセージに対するパーティションキーを関数します。メソッドのサマリー
修飾子と型メソッド説明void
destroy()
protected PartitionedDispatcher
protected void
onInit()
サブクラスは、初期化ロジック用にこれを実装できます。void
setFailover
(boolean failover) チャネルのディスパッチャーでフェイルオーバーを有効にするかどうかを指定します。void
setFailoverStrategy
(PredicateSE<ExceptionSE> failoverStrategy) スローされた例外に対してチャネルのディスパッチャーでフェイルオーバーを有効にするかどうかの戦略を構成します。void
setLoadBalancingStrategy
(LoadBalancingStrategy loadBalancingStrategy) PartitionedDispatcher
にはLoadBalancingStrategy
を指定します。void
setThreadFactory
(ThreadFactorySE threadFactory) パーティションごとにエグゼキュータのThreadFactory
SE を設定します。クラス org.springframework.integration.channel.AbstractExecutorChannel から継承されたメソッド
addInterceptor, addInterceptor, getIntegrationPatternType, hasExecutorInterceptors, removeInterceptor, removeInterceptor, setInterceptors, setMaxSubscribers
クラス org.springframework.integration.channel.AbstractSubscribableChannel から継承されたメソッド
doSend, getSubscriberCount, subscribe, unsubscribe
クラス org.springframework.integration.channel.AbstractMessageChannel から継承されたメソッド
getComponentType, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrack
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
インターフェース org.springframework.messaging.support.InterceptableChannel から継承されたメソッド
getInterceptors
インターフェース org.springframework.messaging.MessageChannel から継承されたメソッド
send, send
インターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
コンストラクターの詳細
PartitionedChannel
public PartitionedChannel(int partitionCount) 指定されたパーティション数に基づいてインスタンスを作成し、IntegrationMessageHeaderAccessor.CORRELATION_ID
メッセージヘッダーからパーティションキーを解決します。- パラメーター:
partitionCount
- このチャネルのパーティションの数。このチャンネルに送信されました。
PartitionedChannel
指定されたパーティション数に基づいてインスタンスを作成し、メッセージに対するパーティションキーを関数します。- パラメーター:
partitionCount
- このチャネルのパーティションの数。partitionKeyFunction
- このチャネルに送信されたメッセージに対してパーティションキーを解決する関数。
メソッドの詳細
setThreadFactory
パーティションごとにエグゼキュータのThreadFactory
SE を設定します。PartitionedDispatcher
まで伝播します。デフォルトは、このチャネルの Bean 名に-partition-thread-
を加えたCustomizableThreadFactory
になります。- パラメーター:
threadFactory
- 使用するThreadFactory
SE。
setFailover
public void setFailover(boolean failover) チャネルのディスパッチャーでフェイルオーバーを有効にするかどうかを指定します。デフォルトではそうなります。無効にするには、この値を "false" に設定します。- パラメーター:
failover
- フェールオーバーブール値。
setFailoverStrategy
スローされた例外に対してチャネルのディスパッチャーがフェイルオーバーを有効にするかどうかの戦略を構成します。setFailover(boolean)
オプションをオーバーライドします。つまり、このオプションまたはそのオプションを設定する必要があります。- パラメーター:
failoverStrategy
- フェールオーバーブール値。- 導入:
- 6.3
setLoadBalancingStrategy
PartitionedDispatcher
にはLoadBalancingStrategy
を指定します。- パラメーター:
loadBalancingStrategy
- 負荷分散戦略の実装。
getDispatcher
- 次で指定:
- クラス
AbstractSubscribableChannel
のgetDispatcher
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupport
サブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
AbstractMessageChannel
のonInit
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean
のdestroy
- 次で指定:
- インターフェース
IntegrationManagement
のdestroy
- オーバーライド:
- クラス
AbstractMessageChannel
のdestroy