クラス ListenerUtils
java.lang.ObjectSE
org.springframework.kafka.listener.ListenerUtils
リスナーユーティリティ。
- 導入:
- 2.0
- 作成者:
- Gary Russell, Francois Rosiere, Antonio Tomac, Wang Zhiyang
メソッドのサマリー
修飾子と型メソッド説明static void
conditionalSleep
(SupplierSE<BooleanSE> shouldSleepCondition, long interval) shouldSleepCondition が true を指定している限り、必要なタイムアウトの間スリープします。static org.apache.kafka.clients.consumer.OffsetAndMetadata
createOffsetAndMetadata
(MessageListenerContainer container, long offset) 指定されたコンテナーとオフセットを使用して新しいOffsetAndMetadata
を作成します。static ListenerType
determineListenerType
(ObjectSE listener) リスナーの型を判別します。static void
stoppableSleep
(MessageListenerContainer container, long interval) コンテナーが実行を継続している限り、必要なタイムアウトの間スリープします。static void
unrecoverableBackOff
(BackOff backOff, ThreadLocalSE<BackOffExecution> executions, ThreadLocalSE<LongSE> lastIntervals, MessageListenerContainer container) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。static void
unrecoverableBackOff
(BackOff backOff, MapSE<ThreadSE, BackOffExecution> executions, MapSE<ThreadSE, LongSE> lastIntervals, MessageListenerContainer container)
メソッドの詳細
determineListenerType
リスナーの型を判別します。- パラメーター:
listener
- リスナー。- 戻り値:
ListenerType
unrecoverableBackOff
@DeprecatedSE(since="3.1", forRemoval=true) public static void unrecoverableBackOff(BackOff backOff, ThreadLocalSE<BackOffExecution> executions, ThreadLocalSE<LongSE> lastIntervals, MessageListenerContainer container) throws InterruptedExceptionSE 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。- パラメーター:
backOff
-BackOff
を使用して新しいBackOffExecution
を作成します。executions
- このスレッドのBackOffExecution
を含むスレッドローカル。lastIntervals
- このスレッドの以前のBackOff
間隔を含むスレッドローカル。container
- コンテナーまたは親コンテナー。- 例外:
InterruptedExceptionSE
- スレッドが中断された場合。- 導入:
- 2.7
unrecoverableBackOff
public static void unrecoverableBackOff(BackOff backOff, MapSE<ThreadSE, BackOffExecution> executions, MapSE<ThreadSE, throws InterruptedExceptionSELongSE> lastIntervals, MessageListenerContainer container) - パラメーター:
backOff
-BackOff
を使用して新しいBackOffExecution
を作成します。executions
- このスレッドのBackOffExecution
を含むスレッドローカル。lastIntervals
- このスレッドの以前のBackOff
間隔を含むスレッドローカル。container
- コンテナーまたは親コンテナー。- 例外:
InterruptedExceptionSE
- スレッドが中断された場合。- 導入:
- 3.1
stoppableSleep
public static void stoppableSleep(MessageListenerContainer container, long interval) throws InterruptedExceptionSE コンテナーが実行を継続している限り、必要なタイムアウトの間スリープします。- パラメーター:
container
- コンテナー。interval
- タイムアウト。- 例外:
InterruptedExceptionSE
- スレッドが中断された場合。- 導入:
- 2.7
conditionalSleep
public static void conditionalSleep(SupplierSE<BooleanSE> shouldSleepCondition, long interval) throws InterruptedExceptionSE shouldSleepCondition が true を指定している限り、必要なタイムアウトの間スリープします。- パラメーター:
shouldSleepCondition
- to。interval
- タイムアウト。- 例外:
InterruptedExceptionSE
- スレッドが中断された場合。- 導入:
- 3.0.9
createOffsetAndMetadata
public static org.apache.kafka.clients.consumer.OffsetAndMetadata createOffsetAndMetadata(MessageListenerContainer container, long offset) 指定されたコンテナーとオフセットを使用して新しいOffsetAndMetadata
を作成します。- パラメーター:
container
- コンテナー。offset
- オフセット。- 戻り値:
- オフセットとメタデータ。
- 導入:
- 2.8.6
unrecoverableBackOff(BackOff, Map, Map, MessageListenerContainer)
を推奨。