クラス KafkaInboundGateway<K,V,R>
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.kafka.inbound.KafkaInboundGateway<K,V,R>
- 型パラメーター:
K
- 鍵の型。V
- リクエスト値型。R
- 応答値の型。
- 実装されたすべてのインターフェース:
Aware
、BeanFactoryAware
、BeanNameAware
、DisposableBean
、InitializingBean
、ApplicationContextAware
、Lifecycle
、Phased
、SmartLifecycle
、ComponentSourceAware
、ExpressionCapable
、OrderlyShutdownCapable
、Pausable
、IntegrationPattern
、KafkaInboundEndpoint
、NamedComponent
、IntegrationInboundManagement
、IntegrationManagement
、ManageableLifecycle
、ManageableSmartLifecycle
、TrackableComponent
public class KafkaInboundGateway<K,V,R>
extends MessagingGatewaySupport
implements KafkaInboundEndpoint, Pausable, OrderlyShutdownCapable
受信ゲートウェイ。
- 導入:
- 5.4
- 作成者:
- Gary Russell, Artem Bilan, Urs Keller
ネストされたクラスのサマリー
クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたネストクラス / インターフェース
MessagingGatewaySupport.ConvertingMessagingTemplate
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドのサマリー
クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたフィールド
messagingTemplate
クラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたフィールド
lifecycleCondition, lifecycleLock
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
インターフェース org.springframework.integration.kafka.inbound.KafkaInboundEndpoint から継承されたフィールド
ATTRIBUTES_HOLDER, CONTEXT_ACKNOWLEDGMENT, CONTEXT_CONSUMER, CONTEXT_RECORD
インターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASE
コンストラクターの概要
コンストラクターコンストラクター説明KafkaInboundGateway
(org.springframework.kafka.listener.AbstractMessageListenerContainer<K, V> messageListenerContainer, org.springframework.kafka.core.KafkaTemplate<K, R> kafkaTemplate) 提供されたコンテナーを使用してインスタンスを構築します。メソッドのサマリー
修飾子と型メソッド説明int
スケジューラー、エグゼキューターなどの通常のシャットダウンの後、シャットダウン遅延が経過した後、残りのアクティブなスケジューラー / エグゼキュータースレッドの強制シャットダウンの前に呼び出されます。オプションで、まだ処理中のアクティブなメッセージの数を返すことができます。int
シャットダウンが始まる前に呼び出されます。protected void
doStart()
サブクラスは、開始動作でこのメソッドを実装する必要があります。protected void
doStop()
サブクラスは、停止動作でこのメソッドを実装する必要があります。サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。protected AttributeAccessor
getErrorMessageAttributes
(Message<?> message) errorMessageStrategy
でエラーメッセージを作成するときに使用するAttributeAccessor
を設定します。boolean
isPaused()
エンドポイントが一時停止しているかどうかを確認します。protected void
onInit()
サブクラスは、初期化ロジック用にこれを実装できます。void
pause()
エンドポイントを一時停止します。void
resume()
一時停止した場合は、エンドポイントを再開します。void
setBindSourceRecord
(boolean bindSourceRecord) true に設定すると、IntegrationMessageHeaderAccessor.SOURCE_DATA
という名前のヘッダーにソースコンシューマーレコードがバインドされます。void
setMessageConverter
(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) メッセージコンバーターを設定します。モードに応じて、RecordMessageConverter
またはBatchMessageConverter
でなければなりません。void
setOnPartitionsAssignedSeekCallback
(BiConsumerSE<MapSE<org.apache.kafka.common.TopicPartition, LongSE>, org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback) シーク管理のためのBiConsumer
SE を指定します無効な参照
ConsumerSeekAware.ConsumerSeekCallback#onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)
KafkaMessageListenerContainer
からの呼び出し。void
setPayloadType
(ClassSE<?> payloadType) StringJsonMessageConverter
などの型対応メッセージコンバーターを使用する場合は、コンバーターが作成するペイロード型を設定します。void
setRecoveryCallback
(org.springframework.retry.RecoveryCallback<?> recoveryCallback) 再試行操作用のRecoveryCallback
インスタンス。null の場合、再試行が終了した後、例外がコンテナーにスローされます(エラーチャネルが設定されていない場合)。void
setRetryTemplate
(org.springframework.retry.support.RetryTemplate retryTemplate) 配信の再試行に使用するRetryTemplate
インスタンスを指定します。クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたメソッド
buildErrorMessage, buildSendTimer, destroy, getErrorChannel, getErrorMessageStrategy, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerObservationRegistry, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setObservationConvention, setReceiverObservationConvention, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrack
クラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたメソッド
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
クラス 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
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAs
インターフェース org.springframework.integration.kafka.inbound.KafkaInboundEndpoint から継承されたメソッド
doWithRetry
インターフェース org.springframework.integration.support.management.ManageableLifecycle から継承されたメソッド
isRunning, start, stop
インターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
コンストラクターの詳細
KafkaInboundGateway
メソッドの詳細
setMessageConverter
public void setMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) メッセージコンバーターを設定します。モードに応じて、RecordMessageConverter
またはBatchMessageConverter
でなければなりません。- パラメーター:
messageConverter
- コンバーター。
setPayloadType
setRetryTemplate
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) 配信の再試行に使用するRetryTemplate
インスタンスを指定します。IMPORTANT: この形式の再試行はブロックされており、ポーリングされたすべてのレコードの合計再試行遅延が
max.poll.interval.ms
を超える可能性がある場合、再調整が発生する可能性があります。代わりに、KafkaErrorSendingMessageRecoverer
で構成されたリスナーコンテナーにDefaultErrorHandler
を追加することを検討してください。- パラメーター:
retryTemplate
- 使用するRetryTemplate
。
setRecoveryCallback
public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback) 再試行操作用のRecoveryCallback
インスタンス。null の場合、再試行が使い果たされた後にコンテナーに例外がスローされます (エラーチャネルが構成されていない場合)。setRetryTemplate(RetryTemplate)
が指定されている場合にのみ使用されます。エラーチャネルが指定されている場合、デフォルトはErrorMessageSendingRecoverer
です。再試行が使い果たされた後にコンテナーに例外をスローする場合は、null に設定します。- パラメーター:
recoveryCallback
- リカバリコールバック。
setOnPartitionsAssignedSeekCallback
public void setOnPartitionsAssignedSeekCallback(BiConsumerSE<MapSE<org.apache.kafka.common.TopicPartition, LongSE>, org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback) シーク管理のためのBiConsumer
SE を指定します無効な参照
ConsumerSeekAware.ConsumerSeekCallback#onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)
KafkaMessageListenerContainer
からの呼び出し。これは内部のMessagingMessageListenerAdapter
実装から呼び出されます。- パラメーター:
onPartitionsAssignedCallback
- 使用するBiConsumer
SE- 関連事項:
setBindSourceRecord
public void setBindSourceRecord(boolean bindSourceRecord) true に設定すると、IntegrationMessageHeaderAccessor.SOURCE_DATA
という名前のヘッダーにソースコンシューマーレコードがバインドされます。- パラメーター:
bindSourceRecord
- バインドする場合は true。
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupport
サブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
MessagingGatewaySupport
のonInit
doStart
protected void doStart()クラスからコピーされた説明:AbstractEndpoint
サブクラスは、開始動作でこのメソッドを実装する必要があります。このメソッドは、AbstractEndpoint.lifecycleLock
を保持しているときに呼び出されます。- オーバーライド:
- クラス
MessagingGatewaySupport
のdoStart
doStop
protected void doStop()クラスからコピーされた説明:AbstractEndpoint
サブクラスは、停止動作でこのメソッドを実装する必要があります。このメソッドは、AbstractEndpoint.lifecycleLock
を保持しているときに呼び出されます。- オーバーライド:
- クラス
MessagingGatewaySupport
のdoStop
pause
resume
isPaused
getComponentType
クラスからコピーされた説明:IntegrationObjectSupport
サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。- 次で指定:
- インターフェース
NamedComponent
のgetComponentType
- オーバーライド:
- クラス
MessagingGatewaySupport
のgetComponentType
beforeShutdown
public int beforeShutdown()インターフェースからコピーされた説明:OrderlyShutdownCapable
シャットダウンが始まる前に呼び出されます。実装は、新しいメッセージの受け入れを停止する必要があります。オプションで、処理中のアクティブなメッセージの数を返すことができます。- 次で指定:
- インターフェース
OrderlyShutdownCapable
のbeforeShutdown
- 戻り値:
- 使用可能な場合、アクティブなメッセージの数。
afterShutdown
public int afterShutdown()インターフェースからコピーされた説明:OrderlyShutdownCapable
スケジューラー、エグゼキューターなどの通常のシャットダウンの後、シャットダウン遅延が経過した後、残りのアクティブなスケジューラー / エグゼキュータースレッドの強制シャットダウンの前に呼び出されます。オプションで、まだ処理中のアクティブなメッセージの数を返すことができます。- 次で指定:
- インターフェース
OrderlyShutdownCapable
のafterShutdown
- 戻り値:
- 使用可能な場合、アクティブなメッセージの数。
getErrorMessageAttributes
クラスからコピーされた説明:MessagingGatewaySupport
errorMessageStrategy
でエラーメッセージを作成するときに使用するAttributeAccessor
を設定します。- オーバーライド:
- クラス
MessagingGatewaySupport
のgetErrorMessageAttributes
- パラメーター:
message
- メッセージ。- 戻り値:
- 属性。