Question about using the @KafkaListener autoStartup = "false" for multiple topics

user1213428

With the following

@KafkaListener(id = "id1", autoStartup = "false", topics = { "topic1", "topic2" } spring.kafka.consumer.auto-offset-reset=earliest

Assume there are multiple messages in each topic before .start is run

When

KafkaListenerEndpointRegistry.getListenerContainer("id1").start();

is called is there a guarantee that all messages from topic1 will get processed before topic2 (that is what I am seeing), and what happens if messages are sent to topic1 while topic2 is getting processed.

+++++++++++++++++++++++++++++++++++++++++++++++++

Edit

Ran the following test, each topic has a single partition. Before the test was run there were 10 messages in topic1 and 10 messages in topic2. Ran the code and let the 10 topic1 messages get processed but while the topic2 messages where getting processed I sent in more messages to topic1 but there where not processed by the listener until all the preexisting messages from topic2 had been processed.

So it seems like the messages are processed in order from the topics property array and any new messages are not processed until the existing ones are processed.

The order the messages where processed in topic1 message 1 topic1 message 2 ... topic1 message 10 topic2 message 1 topic2 message 2 ... ... sent message 11 to topic 1 at this time ... topic2 message 10 topic1 message 11

Gary Russell

There is no such guarantee.

See answers to this question.

Kafka gives you only the guarantee of messages ordering inside a partition. ...

Regarding your use case with two topics there is no relation between subscription order to the topics and messages ordering even because ...

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

add and edit multiple topics using redux form

分類Dev

A question about deconvolution of a signal using Python scipy

分類Dev

Question about pip using Python from Windows Store

分類Dev

What is the simplest Spring Kafka @KafkaListener configuration to consume all records from a set of compacted topics?

分類Dev

Kafka Producer design - multiple topics

分類Dev

autoStartupがfalseに設定されている場合、Spring Cloud Stream Bindersを手動で開始する方法

分類Dev

Question about wget -qO-

分類Dev

very basic question about ppa

分類Dev

Question about Ubuntu version 15.10

分類Dev

Android firebase true way for subscribe to multiple topics

分類Dev

Question about merge two sorted list(leetcode question 21)

分類Dev

Question about behavior of control key shortcuts

分類Dev

confusion about subproblem in dynamic programming question

分類Dev

Beginner's question about function signature

分類Dev

Newbie question about JavaScript promises and "then" statements

分類Dev

Question about subqueries, why there is a need for a IN clause

分類Dev

Isabelle/HOL Question about Sets of Tuples

分類Dev

Apache Airflow: Question about Dynamic Tasks and Parallelism

分類Dev

C++ Question about two class constructors

分類Dev

Question about Common Lisp compilation order

分類Dev

A question about add element at the end of a linked list

分類Dev

A question about how JVM allocates memory for primitives

分類Dev

Question about Culture:RFC5646 and ContentDefinitions

分類Dev

How to programmatically create topics using kafka-python?

分類Dev

Formula for Multiple True and False Statements

分類Dev

Autocomplete Chip when multiple is false

分類Dev

Solving the algorithm question using javascript

分類Dev

Appropriate location of the .git file, directory arrangement and question about `REMOTE URL`

分類Dev

Botframework V4: Question about Input forms cards

Related 関連記事

  1. 1

    add and edit multiple topics using redux form

  2. 2

    A question about deconvolution of a signal using Python scipy

  3. 3

    Question about pip using Python from Windows Store

  4. 4

    What is the simplest Spring Kafka @KafkaListener configuration to consume all records from a set of compacted topics?

  5. 5

    Kafka Producer design - multiple topics

  6. 6

    autoStartupがfalseに設定されている場合、Spring Cloud Stream Bindersを手動で開始する方法

  7. 7

    Question about wget -qO-

  8. 8

    very basic question about ppa

  9. 9

    Question about Ubuntu version 15.10

  10. 10

    Android firebase true way for subscribe to multiple topics

  11. 11

    Question about merge two sorted list(leetcode question 21)

  12. 12

    Question about behavior of control key shortcuts

  13. 13

    confusion about subproblem in dynamic programming question

  14. 14

    Beginner's question about function signature

  15. 15

    Newbie question about JavaScript promises and "then" statements

  16. 16

    Question about subqueries, why there is a need for a IN clause

  17. 17

    Isabelle/HOL Question about Sets of Tuples

  18. 18

    Apache Airflow: Question about Dynamic Tasks and Parallelism

  19. 19

    C++ Question about two class constructors

  20. 20

    Question about Common Lisp compilation order

  21. 21

    A question about add element at the end of a linked list

  22. 22

    A question about how JVM allocates memory for primitives

  23. 23

    Question about Culture:RFC5646 and ContentDefinitions

  24. 24

    How to programmatically create topics using kafka-python?

  25. 25

    Formula for Multiple True and False Statements

  26. 26

    Autocomplete Chip when multiple is false

  27. 27

    Solving the algorithm question using javascript

  28. 28

    Appropriate location of the .git file, directory arrangement and question about `REMOTE URL`

  29. 29

    Botframework V4: Question about Input forms cards

ホットタグ

アーカイブ