pulsar-client-node icon indicating copy to clipboard operation
pulsar-client-node copied to clipboard

send delayed message, but consume immediately

Open immatt2015 opened this issue 2 years ago • 3 comments

pulsar-server 3.0.1 pulsar-client 1.9.0 node v19.6.0

I cannot send delayed messages.

            producer.send({
                data: Buffer.from(JSON.stringify(Date.now())),
                deliverAfter: 30000
            });

Is there some thing wrong?

immatt2015 avatar Oct 19 '23 07:10 immatt2015

Can you check your broker configuration?

https://pulsar.apache.org/docs/3.1.x/concepts-messaging/#broker

shibd avatar Oct 19 '23 15:10 shibd

Delayed message delivery is enabled.

delayedDeliveryEnabled=true
delayedDeliveryTrackerFactoryClassName=org.apache.pulsar.broker.delayed.InMemoryDelayedDeliveryTrackerFactory
delayedDeliveryTickTimeMillis=1000

I think broker configs is ok.

Golang client works.

immatt2015 avatar Oct 20 '23 02:10 immatt2015

https://github.com/shibd/pulsar-node-delayed-test

You can refer to this repository for testing.

shibd avatar Oct 30 '23 09:10 shibd