datastax / pulsar-jms

DataStax Starlight for JMS, a JMS API for Apache Pulsar ®
Apache License 2.0
48 stars 21 forks source link

Allow direct message replaying by exposing Pulsar API's seek() function #11

Open yabinmeng opened 2 years ago

yabinmeng commented 2 years ago

When we use Pulsar as the underlying message processing platform, one big benefit is to allow message replaying. This feature is beyond the capability of existing JMS technologies although it is desired in certain use cases.

Since Starlight for JMS API is based on Pulsar's native client API. It is therefore possible to achieve message replay by exposing Pulsar consumer and reader API's cursor seeking capability. For example, by exposing seek(long timestamp), we can actually replay historical messages up to a certain time.

I understand that this is not part of the JMS spec. We could make this as a special bonus feature when we use Pulsar as the underlying messaging platform.

eolivelli commented 2 years ago

Do you have some suggestion for this new API ? Would you add it to the MessageConsumer API ?