クラス 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, Jooyoung Pyoung
ネストされたクラスの概要
クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたネストクラス / インターフェース
MessagingGatewaySupport.ConvertingMessagingTemplateインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesインターフェース org.springframework.integration.kafka.inbound.KafkaInboundEndpoint から継承されたネストクラス / インターフェース
KafkaInboundEndpoint.RetryContextフィールド概要
クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたフィールド
messagingTemplateクラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたフィールド
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 voiddoStart()サブクラスは、開始動作でこのメソッドを実装する必要があります。protected voiddoStop()サブクラスは、停止動作でこのメソッドを実装する必要があります。protected AttributeAccessorgetErrorMessageAttributes(@Nullable Message<?> message) errorMessageStrategyでエラーメッセージを作成するときに使用するAttributeAccessorを設定します。booleanisPaused()エンドポイントが一時停止しているかどうかを確認します。protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidpause()エンドポイントを一時停止します。voidresume()一時停止した場合は、エンドポイントを再開します。voidsetBindSourceRecord(boolean bindSourceRecord) true に設定すると、IntegrationMessageHeaderAccessor.SOURCE_DATAという名前のヘッダーにソースコンシューマーレコードがバインドされます。voidsetMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) メッセージコンバーターを設定します。モードに応じて、RecordMessageConverterまたはBatchMessageConverterでなければなりません。voidsetOnPartitionsAssignedSeekCallback(BiConsumerSE<MapSE<org.apache.kafka.common.TopicPartition, LongSE>, org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback) KafkaMessageListenerContainerからのConsumerSeekAware.onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)呼び出し中にシーク管理用のBiConsumerSE を指定します。voidsetPayloadType(ClassSE<?> payloadType) StringJsonMessageConverterなどの型対応メッセージコンバーターを使用する場合は、コンバーターが作成するペイロード型を設定します。voidsetRecoveryCallback(RecoveryCallback<?> recoveryCallback) 再試行操作用のRecoveryCallbackインスタンス。null の場合、再試行回数が尽きた後にコンテナーに例外がスローされます (エラーチャネルが構成されていない限り)。voidsetRetryTemplate(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インターフェース org.springframework.context.SmartLifecycle から継承されたメソッド
isPauseable
コンストラクターの詳細
KafkaInboundGateway
メソッドの詳細
setMessageConverter
public void setMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) メッセージコンバーターを設定します。モードに応じて、RecordMessageConverterまたはBatchMessageConverterでなければなりません。- パラメーター:
messageConverter- コンバーター。
setPayloadType
setRetryTemplate
配信の再試行に使用するRetryTemplateインスタンスを指定します。IMPORTANT: この形式の再試行はブロックされており、ポーリングされたすべてのレコードの合計再試行遅延が
max.poll.interval.msを超える可能性がある場合、再調整が発生する可能性があります。代わりに、KafkaErrorSendingMessageRecovererで構成されたリスナーコンテナーにDefaultErrorHandlerを追加することを検討してください。- パラメーター:
retryTemplate- 使用するRetryTemplate。
setRecoveryCallback
再試行操作用の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) KafkaMessageListenerContainerからのConsumerSeekAware.onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)呼び出し中のシーク管理用にBiConsumerSE を指定します。これは、内部MessagingMessageListenerAdapter実装から呼び出されます。- パラメーター:
onPartitionsAssignedCallback- 使用するBiConsumerSE- 関連事項:
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
- 次で指定:
- インターフェース
NamedComponentのgetComponentType - オーバーライド:
- クラス
MessagingGatewaySupportのgetComponentType
beforeShutdown
public int beforeShutdown()インターフェースからコピーされた説明:OrderlyShutdownCapableシャットダウンが始まる前に呼び出されます。実装は、新しいメッセージの受け入れを停止する必要があります。オプションで、処理中のアクティブなメッセージの数を返すことができます。- 次で指定:
- インターフェース
OrderlyShutdownCapableのbeforeShutdown - 戻り値:
- 使用可能な場合、アクティブなメッセージの数。
afterShutdown
public int afterShutdown()インターフェースからコピーされた説明:OrderlyShutdownCapableスケジューラー、エグゼキューターなどの通常のシャットダウンの後、シャットダウン遅延が経過した後、残りのアクティブなスケジューラー / エグゼキュータースレッドの強制シャットダウンの前に呼び出されます。オプションで、まだ処理中のアクティブなメッセージの数を返すことができます。- 次で指定:
- インターフェース
OrderlyShutdownCapableのafterShutdown - 戻り値:
- 使用可能な場合、アクティブなメッセージの数。
getErrorMessageAttributes
クラスからコピーされた説明:MessagingGatewaySupporterrorMessageStrategyでエラーメッセージを作成するときに使用するAttributeAccessorを設定します。- オーバーライド:
- クラス
MessagingGatewaySupportのgetErrorMessageAttributes - パラメーター:
message- メッセージ。- 戻り値:
- 属性。