pulsar-flink icon indicating copy to clipboard operation
pulsar-flink copied to clipboard

Does FlinkPulsarSource support multiple thread to consume one topic?

Open Johnnyhooyo opened this issue 4 years ago • 6 comments

now it's seems to only single thread for each topic even partitioned topic.

Johnnyhooyo avatar Jun 15 '21 03:06 Johnnyhooyo

@Johnnyhooyo ~Yes, if you need faster consumption, you can try to increase the parallelism of flink job.~ Sorry, the number of Pulsar topic partitions and Flink parallelism is 1:1 .

jianyun8023 avatar Jun 15 '21 11:06 jianyun8023

@Johnnyhooyo Yes, if you need faster consumption, you can try to increase the parallelism of flink job.

In my job, the topic has 2 partition, and parallelism of source is 4. then just 2 thread consume the message.

I see the connector use reader to consume message, and the reader not support "subscriptionType.shared"

Johnnyhooyo avatar Jun 16 '21 02:06 Johnnyhooyo

image look at that, the parallelism of job is 4 @jianyun8023

Johnnyhooyo avatar Jun 17 '21 06:06 Johnnyhooyo

hi , I hit same problem. I set the pulsar partition to 1, enable-key-hash-range to true, and use flink source with 4 threads to read it, only one thread can consume message.

seems shared read doesn't take effect!

shulaoh avatar Sep 10 '21 03:09 shulaoh

just curious why this issue is not responded since it is a fundamental feature...

shulaoh avatar Sep 10 '21 03:09 shulaoh

@Johnnyhooyo @shulaoh Sorry, the number of Pulsar topic partitions and Flink parallelism is 1:1. This is because the connector uses the Pulsar Reader API to consume data, and the Reader uses exclusive mode to consume, so only one reader can consume a partition.

If you want to use Pulsar consume API to solve this limitation, you can read about Pulsar Source in Flink 1.14.

jianyun8023 avatar Nov 17 '21 15:11 jianyun8023