BewareMyPower commented on issue #11915:
URL: https://github.com/apache/pulsar/issues/11915#issuecomment-914003298
Here is my test script:
```python
import datetime
import faulthandler
import pulsar
faulthandler.enable()
if __name__ == '__main__':
client = pulsar.Client('pulsar://localhost:6650')
topic = 'my-topic-py'
consumer = client.subscribe(
topic=topic,
subscription_name='sub',
consumer_type=pulsar.ConsumerType.Shared,
initial_position=pulsar.InitialPosition.Earliest,
)
producer = client.create_producer(
topic=topic,
compression_type=pulsar.CompressionType.LZ4,
block_if_queue_full=True,
send_timeout_millis=0
)
producer.send_async(
content='test'.encode('utf-8'),
callback=lambda res, msg_id: print(res),
partition_key=None,
deliver_after=datetime.timedelta(seconds=5.0)
)
msg = consumer.receive()
print(msg.value())
```
Output:
```
2021-09-07 13:32:35.643 INFO [0x11aa64e00] Client:88 | Subscribing on Topic
:my-topic-py
2021-09-07 13:32:35.644 INFO [0x11aa64e00] ClientConnection:181 | [<none>
-> pulsar://localhost:6650] Create ClientConnection, timeout=10000
2021-09-07 13:32:35.644 INFO [0x11aa64e00] ConnectionPool:96 | Created
connection for pulsar://localhost:6650
2021-09-07 13:32:35.647 INFO [0x7000042a8000] ClientConnection:366 |
[127.0.0.1:59114 -> 127.0.0.1:6650] Connected to broker
2021-09-07 13:32:35.653 INFO [0x7000042a8000] HandlerBase:64 |
[persistent://public/default/my-topic-py, sub, 0] Getting connection from pool
2021-09-07 13:32:35.674 INFO [0x7000042a8000] ConsumerImpl:214 |
[persistent://public/default/my-topic-py, sub, 0] Created consumer on broker
[127.0.0.1:59114 -> 127.0.0.1:6650]
2021-09-07 13:32:35.677 INFO [0x7000042a8000] HandlerBase:64 |
[persistent://public/default/my-topic-py, ] Getting connection from pool
2021-09-07 13:32:35.680 INFO [0x7000042a8000] ProducerImpl:188 |
[persistent://public/default/my-topic-py, ] Created producer on broker
[127.0.0.1:59114 -> 127.0.0.1:6650]
Ok
b'test'
2021-09-07 13:32:40.993 INFO [0x11aa64e00] ProducerImpl:590 | Producer -
[persistent://public/default/my-topic-py, standalone-0-2] , [batching = off]
2021-09-07 13:32:40.993 WARN [0x11aa64e00] ProducerImpl:113 |
[persistent://public/default/my-topic-py, standalone-0-2] Destroyed producer
which was not properly closed
2021-09-07 13:32:40.995 ERROR [0x7000042a8000] ClientConnection:572 |
[127.0.0.1:59114 -> 127.0.0.1:6650] Read failed: Operation canceled
2021-09-07 13:32:40.995 INFO [0x11aa64e00] ClientConnection:1495 |
[127.0.0.1:59114 -> 127.0.0.1:6650] Connection closed
```
I cannot install Python client 2.7.0 in my local env so I didn't test it.
The `pip3 install` stuck at:
```
Building wheels for collected packages: grpcio, ratelimit
Building wheel for grpcio (setup.py) ... |
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]