Skip to content

Support get topic applied policy #9216

Closed

Description

@codelipenghui

Is your feature request related to a problem? Please describe.
Provide a way to get the applied policy of the topic. In Pulsar, the topic will apply the topic level policy if present or apply the namespace policy if present or use the broker level configuration. It needs to support get the applied policy for a topic that might use the namespace policy or topic policy or broker level default configuration.

Describe the solution you'd like
Add "--applied" for the get policy cmd. For example:

bin/pulsar-admin topics get-retention --applied
  • 1. MessageTTL
  • 2. Retention Policy
  • 3. Message Dispatch Rate
  • 4. Backlog Quota
  • 5. Persistence Policy
  • 6. Max Producer
  • 7. Max Consumer
  • 8. Compaction Threshold
  • 9. Deduplication
  • 10. Offload Policy
  • 11. MaxUnackMessagesPerConsumer
  • 12. MaxUnackMessagesPerSubscription
  • 13. DelayedDeliveryPolicies
  • 14. Inactive topic policy

Activity

  1. added
    type/feature
    on Jan 15, 2021
  2. added this to the 2.8.0 milestone on Jan 15, 2021
  3. 315157973 commented on Jan 17, 2021

    @315157973
    Contributor

    I will work on it

  4. added
    doc-required
    on Jan 18, 2021
  5. Anonymitaet commented on Jan 22, 2021

    @Anonymitaet
    Member

    @315157973 thanks for your contribution.

    Could you please add doc once you finish all code work?
    Pulsar admin doc and REST API doc are automatically generated from codes, you can add corresponding descriptions in the code files. Thanks again.

  6. 315157973 commented on Jan 22, 2021

    @315157973
    Contributor

    @315157973 thanks for your contribution.

    Could you please add doc once you finish all code work?
    Pulsar admin doc and REST API doc are automatically generated from codes, you can add corresponding descriptions in the code files. Thanks again.

    OK

  7. 19 remaining items

  8. Anonymitaet commented on Apr 9, 2021

    @Anonymitaet
    Member

    @315157973 thanks for your great contribution!

    Since you've finished all code work, could u pls add docs for them? Then users know your changes and how to use it.

    I think the descriptions should be added to pulsar-admin, REST API, or Java admin API if needed.

    Below is an example.
    image

    Feel free to ping me if you need doc review.

    After doc is added, we can close this issue.

  9. 315157973 commented on Apr 9, 2021

    @315157973
    Contributor

    There are descriptions in my code, and we already have automatic document generation tools, so I don’t need to add them manually, right? @Anonymitaet

  10. 315157973 commented on Apr 9, 2021

    @315157973
    Contributor

    image

    Looks like it has been generated

  11. Anonymitaet commented on Apr 9, 2021

    @Anonymitaet
    Member

    @315157973 yes, the "docs" are added in the code files and they will be shown on websites automatically.

    One thing should pay attention to is that if your changes apply to pulsar-admin, REST API, and Java admin API, make sure the "docs" are added there. Do your changes apply to these 3 websites?

  12. 315157973 commented on Apr 9, 2021

    @315157973
    Contributor

    "docs" are added in pulsar-admin, REST API.
    The Java admin API does not seem to be automatically generated yet?
    Many new APIs do not exist, not just those I added

  13. Anonymitaet commented on Apr 9, 2021

    @Anonymitaet
    Member

    @315157973 Java admin API is the same as what you did for pulsar-admin and REST API.
    If you want to add docs for Java admin API, you may need to add descriptions to these files.

  14. 315157973 commented on Apr 10, 2021

    @315157973
    Contributor

    All of my new APIs have descriptions. However, my new APIs and many old APIs with descriptions are not displayed in Java admin API. Please help to check the tool. @Anonymitaet
    For example:

    /**
    * Set message TTL for a topic.
    *
    * @param topic
    * Topic name
    * @param messageTTLInSecond
    * Message TTL in second.
    * @throws NotAuthorizedException
    * Don't have admin permission
    * @throws NotFoundException
    * Topic does not exist
    * @throws PulsarAdminException
    * Unexpected error
    */
    void setMessageTTL(String topic, int messageTTLInSecond) throws PulsarAdminException;

    This API has been around for a long time, but it does not appear in the Java admin API

  15. Anonymitaet commented on Apr 12, 2021

    @Anonymitaet
    Member

    @315157973

    setMessageTTL(String topic, int messageTTLInSecond) is shown on https://pulsar.apache.org/api/admin/2.7.0-SNAPSHOT/ but not shown on https://pulsar.apache.org/api/admin/.

    I've checked all commands and documented details here. I found that all commands (except setMessageTTL(String topic, int messageTTLInSecond) are not shown on any version of the Java Admin API website.

  16. Anonymitaet commented on Apr 12, 2021

    @Anonymitaet
    Member

    Hi @tuteng

    @315157973 has added various commands and docs correspondingly in their source code files.

    Docs for pulsar-admin and REST API are shown on websites but docs for Java Admin API are not shown on any version of the Java Admin API website (https://pulsar.apache.org/api/admin/2.7.0-SNAPSHOT/ or https://pulsar.apache.org/api/admin/).

    Do you have any clues? Many thanks.

  17. Anonymitaet commented on Apr 13, 2021

    @Anonymitaet
    Member

    Hi @tuteng could u pls give us some instructions? Many thanks.

  18. Anonymitaet commented on Apr 15, 2021

    @Anonymitaet
    Member

    @315157973 the docs you added for Java Admin API should be shown on https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/, however, currently https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/ is not generated yet and it should be generated after 2.7.1 is released. I've discussed w/ @tuteng and opened this issue to track. He will handle it.

    Since code work has been finished and all docs have been added to source code files (pulsar-admin, REST API, and Java admin API), I'll close this issue and keep an eye for the commands that should be shown on https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/ once https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/ is generated.

  19. added
    doc
    and removed
    doc-required
    on Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

doctype/feature

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions