Skip to content

Kafka consumer subscribe/assign problems #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
devbrom opened this issue Jun 1, 2018 · 1 comment
Closed

Kafka consumer subscribe/assign problems #454

devbrom opened this issue Jun 1, 2018 · 1 comment
Milestone

Comments

@devbrom
Copy link

devbrom commented Jun 1, 2018

Correct me if I am wrong

Now consumer can not subscribe to the topic. There is only a possibility to assign to a specific partition of topic. And if partition is not specified then the consumer assign to the zero partition.

    public function receive($timeout = 0)
    {
        if (false == $this->subscribed) {
            $this->consumer->assign([new TopicPartition(
                $this->getQueue()->getQueueName(),
                $this->getQueue()->getPartition(),
                $this->offset
            )]);
            $this->subscribed = true;
        }
        $message = null;
        if ($timeout > 0) {
            $message = $this->doReceive($timeout);
        } else {
            while (true) {
                if ($message = $this->doReceive(500)) {
                    break;
                }
            }
        }
        return $message;
    }

Problems:

  1. One consumer can only read from one partition
    (this contradicts ideology of Kafka https://kafka.apache.org/intro#intro_consumers)
  2. Not possible to automatically rebalance consumer group
@makasim
Copy link
Member

makasim commented Aug 21, 2018

fixed in #508

@makasim makasim closed this as completed Aug 21, 2018
@makasim makasim added this to the 0.9 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants