Create Key_Shared Consumer Apache Pulsar

505 views Asked by At

I use the Apache Pulsar Python clients to connect my micro services. I want to create Key_Shared Consumer doing like:

import pulsar,_pulsar                

client = pulsar.Client('pulsar://localhost:6650')
consumer = client.subscribe('my-topic', 'consume-id',
             consumer_type=_pulsar.ConsumerType.KeyShared)

But I got the following error:

AttributeError: type object 'ConsumerType' has no attribute 'KeyShared'

Does the KeyShared has been implemented in the Python client ? If yes how can I use it ?

1

There are 1 answers

1
Matteo Merli On

It was released in 2.4.2 for the Python client.