David Siro
David Siro

Reputation: 1906

Apache Pulsar - acknowledge from different thread

I've spun up a Pulsar Java consumer in thread T1 and I'm handing over the messages for processing to thread T2.

Is it safe to acknowledge messages from T2? Specifically, is calling consumer.acknowledge(messageId) on the instance shared between two threads ok?

Upvotes: 5

Views: 433

Answers (1)

Ivan Kelly
Ivan Kelly

Reputation: 204

Yes, the java client is thread safe, so the interaction you described should be fine.

Upvotes: 5

Related Questions