Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

fix: Fix wrong model field #42

Merged
merged 1 commit into from
Aug 13, 2023
Merged

fix: Fix wrong model field #42

merged 1 commit into from
Aug 13, 2023

Conversation

mattisonchao
Copy link
Member

@mattisonchao mattisonchao commented Aug 12, 2023

Motivation

The Apache pulsar request model is as follows:

image

Modifications

  • Change PartitionedIndex to PartitionIndex

Verification

@mattisonchao mattisonchao requested a review from a team as a code owner August 12, 2023 14:09
@mattisonchao mattisonchao changed the title Fix wrong model field fix: Fix wrong model field Aug 12, 2023
Copy link

@BewareMyPower BewareMyPower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain more about it? It's very disappointing and confusing to see the ecosystem must keep the same field name with the Java client. It even makes the Java side more easily to make breaking changes. IIUC, if I changed any protected field of MessageIdImpl, a new breaking change would be introduced.

@mattisonchao
Copy link
Member Author

@BewareMyPower
I've changed the pic. It would be more make sense.

@mattisonchao
Copy link
Member Author

In the previous design, pulsar-admin-go choose to use messageId as a restful request model and param. therefore, it should keep the same field as the admin server. not for pulsar clients. :)

@tuteng tuteng merged commit 837fac5 into streamnative:master Aug 13, 2023
6 of 7 checks passed
@mattisonchao mattisonchao deleted the fix/model branch August 13, 2023 12:51
@mattisonchao
Copy link
Member Author

@tuteng could you please cherry-pick it to previous branches by any chance?

tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
Master Issue: streamnative/pulsar-admin-go#2 

##OUTPUT 
 *last-message-id*
```
➜  pulsarctl git:(topic-lastmessage) ./pulsarctl topic last-message-id -h
USED FOR:
    This command is used for getting the last message id of a topic (partition).

REQUIRED PERMISSION:
    This command requires tenant admin permissions.

EXAMPLES:
    #Get the last message id of a topic <persistent-topic-name>
    pulsarctl topic last-message-id <persistent-topic-name>

    #Get the last message id of a partitioned topic <topic-name>
    pulsarctl topic last-message-id --partition-index <partition> <topic-name>

OUTPUT:
    #normal output
    {
      "LedgerId": 0,
      "EntryId": 0,
      "PartitionedIndex": 0
    }

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the topic <persistent-topic-name> does not exist in the cluster
    [✖]  code: 404 reason: Topic not found

    #the topic <persistent-topic-name> does not a persistent topic
    [✖]  code: 405 reason: GetLastMessageId on a non-persistent topic is not allowed

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics last-message-id [flags]

Aliases: last-message-id, lmi
```
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
tisonkun pushed a commit to apache/pulsar-client-go that referenced this pull request Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants