You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2024/12/10 09:42:01 UTC

Re: [D] Why is deadLetterPolicy attribute in the ConsumerConfigurationData class marked as transient? [pulsar]

GitHub user lhotari added a comment to the discussion: Why is deadLetterPolicy attribute in the ConsumerConfigurationData class marked as transient?

@AnuragReddy2000  Thanks for investigating this issue. It would be useful to first create an issue in https://github.com/apache/pulsar/issues about the problem that you are facing with the pulsar-storm adaptor when the `deadLetterPolicy` gets lost. 

I don't see a reason why field `deadLetterPolicy` should be transient. In the referenced PR #9630, the correct resolution would have been to make `DeadLetterPolicy` class implement `java.io.Serializable` and add  `private static final long serialVersionUID = 1L;` field instead of making it a transient field. It looks like there are multiple other problems in the PR and `deadLetterPolicy` isn't the only issue. The same issue applies to `keySharedPolicy` and `messageCrypto` fields.

Some of the classes and fields in the object tree of `ConsumerConfigurationData` would require custom serialization to properly resolve the issue and possibly some other solutions. For example `MessageCrypto` implementations are such. It might not be trivial to resolve it.

`deadLetterPolicy` and `keySharedPolicy` seem straightforward to resolve. Making the implementation classes implement `java.io.Serializable` and adding `private static final long serialVersionUID = 1L;` field.

Please go ahead, create the issue and the PR to address this.

GitHub link: https://github.com/apache/pulsar/discussions/23076#discussioncomment-11518324

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org