[
https://issues.apache.org/jira/browse/KAFKA-4905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15927000#comment-15927000
]
Matthias J. Sax commented on KAFKA-4905:
----------------------------------------
I am not sure if I can follow: What I don't understand is, how you could end up
with two (Streams) consumers that subscribe to different topics? You specify
your Topology via {{TopologyBuilder}} or {{KStreamBuilder}} and this ensures,
that all used consumers of the Streams app subscribe to the same topics. Or do
you try to use {{StreamPartitionAssigner}} "outside" of Streams (ie, for
consumers you manually instantiate)? For this case, it's a "user error" as
{{StreamPartitionAssigner}} was never designed to be use "outside" of Streams
(note, it belongs to package {{internals}} and thus is not part of public API).
> StreamPartitionAssignor doesn't respect subscriptions to assign partitions.
> ---------------------------------------------------------------------------
>
> Key: KAFKA-4905
> URL: https://issues.apache.org/jira/browse/KAFKA-4905
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Affects Versions: 0.10.2.0
> Reporter: Florian Hussonnois
>
> Both RangeAssignor and RoundRobinAssignor use the subscriptions to assign
> partition to each consumer. This allow to have two consumers belonging to the
> the same group and subscribing to two differents topics.
> This doesn't seem to be the case of the StreamPartitionAssignor resulting to
> an IllegalArgumentException thrown during rebalance.
> java.lang.IllegalArgumentException: Assigned partition foo-2 for
> non-subscribed topic regex pattern; subscription pattern is bar
> at
> org.apache.kafka.clients.consumer.internals.SubscriptionState.assignFromSubscribed(SubscriptionState.java:190)
> at
> org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.onJoinComplete(ConsumerCoordinator.java:216)
> at
> org.apache.kafka.clients.consumer.internals.AbstractCoordinator.joinGroupIfNeeded(AbstractCoordinator.java:352)
> at
> org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureActiveGroup(AbstractCoordinator.java:303)
> This is because the consumer group leader attempt to assign partitions to a
> consumer that didn't subscribe to the associated topic.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)