Skip to content

Mismatch Between Registered and Found Callbacks in Multi-group Listener Cases #3328

@bky373

Description

@bky373

In what version(s) of Spring for Apache Kafka are you seeing this issue?

For example:

3.2

Describe the bug

  • When using AbstractConsumerSeekAware in a multi-group listener scenario, there are cases where the number of registered callbacks differs from the number of discovered callbacks. Let's consider the examples below.

  • Case 1:

    • Topic partitions: 1
    • Consumer groups: 2 (group1, group2)
    • Registered callbacks: 2 (group1 thread callback and group2 thread callback)
    • Discovered callbacks: 1 (either group1 thread callback or group2 thread callback — only one callback exists assigned to topic partition 0)
  • Case 2 - with concurrency:

    • Topic partitions: 2
    • Consumer groups: 2 (group1, group2)
    • Concurrency: 2 per group
    • Registered callbacks: 4
      • group1-0 thread callback, group1-1 thread callback, group2-0 thread callback, group2-1 thread callback
    • Discovered callbacks: 2
      • 1 thread assigned to partition 0 and 1 thread assigned to partition 1 (uncertain whether they belong to group1 or group2 threads)

Expected behavior

  • The number of discovered callbacks should be equal to the number of registered callbacks.

Sample

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions