You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by Yong Zhang <zh...@gmail.com> on 2019/10/28 10:29:04 UTC

Pulsar go admin client and pulsarctl

Hi Pulsar community,

We just open sourced a Pulsar go admin client library and a CLI tool `pulsarctl` built on top of it. If you are writing Golong applications to interact with Pulsar, definitely check this out! 

https://github.com/streamnative/pulsarctl

pulsarctl command reference:  https://streamnative.io/docs/pulsarctl/v0.1.0/

If you have any questions, feel free to ping us!  Contributions are welcome!

Thanks,


—

Yong,
Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by Sijie Guo <gu...@gmail.com>.
Awesome! Yong can probably create a github issue to add this feature.

Thanks,
Sijie

On Tue, Oct 29, 2019 at 10:56 PM Brian Candler <b....@pobox.com> wrote:

> On 29/10/2019 12:45, Sijie Guo wrote:
> > I think we can improve the CLI by adding an option `-o` or `--output`.
> > Let user choose the way to dump the results, either PLAIN, TABLE, or
> JSON.
> >
> > Does this approach work for you?
>
> Certainly works for me.
>
>

Re: Pulsar go admin client and pulsarctl

Posted by Brian Candler <b....@pobox.com>.
On 29/10/2019 12:45, Sijie Guo wrote:
> I think we can improve the CLI by adding an option `-o` or `--output`. 
> Let user choose the way to dump the results, either PLAIN, TABLE, or JSON.
>
> Does this approach work for you?

Certainly works for me.


Re: Pulsar go admin client and pulsarctl

Posted by Sijie Guo <gu...@gmail.com>.
Hi Brian,

Thank you for your comments.

Here are some replies to your comments.

> Comment 1

We were thinking that "subscriptions" should be a first-class citizen in
the CLI. so we moved the subscription related commands to a separate
command group.

We can consider supporting the old style commands as well if needed.

> Comment 2

I think we can improve the CLI by adding an option `-o` or `--output`. Let
user choose the way to dump the results, either PLAIN, TABLE, or JSON.

Does this approach work for you?

> Comment 3

Yong sent out a pull request to fix this issue. Thank you for reporting it.

- Sijie

On Mon, Oct 28, 2019 at 8:16 PM Brian Candler <b....@pobox.com> wrote:

> On 28/10/2019 11:49, Brian Candler wrote:
> >
> > Many, many thanks for this - I will be compiling it shortly.
>
> I see you already made a binary release of pulsarctl, so even better :-)
>
> Comment 1: I find the CLI doesn't follow the Java pulsar-admin CLI.
>
> # pulsar-admin version
> $ apache-pulsar-2.4.1/bin/pulsar-admin topics subscriptions
> persistent://public/default/my-topic
> my-subscription
> first-subscription
>
> # pulsarctl version
> $ ./pulsarctl subscriptions list persistent://public/default/my-topic
> +--------------------+
> |   SUBSCRIPTIONS    |
> +--------------------+
> | my-subscription    |
> | first-subscription |
> +--------------------+
>
> I now have a new set of commands to learn - although maybe I'll just
> forget the Java ones going forward.
>
> Comment 2: I can't see a way to disable the table formatting, e.g. to
> get just the raw list of subscriptions in the example above.  This would
> be useful for simple scripting.  An option to return all tables as csv
> or tsv would be nice.  (Ditto for clusters list, brokers list)
>
> JSON would be another option, especially since some commands already
> give JSON output (e.g. topic lookup, topic stats)
>
> Comment 3: There is a newline missing after the command output here:
>
> ubuntu@pulsar:~$ ./pulsarctl topic compact-status public/default/my-topic
> Compacting the topic persistent://public/default/my-topic is not
> runningubuntu@pulsar:~$
>
> But this is a great start, thanks again!
>
> Regards,
>
> Brian.
>
>

Re: Pulsar go admin client and pulsarctl

Posted by Brian Candler <b....@pobox.com>.
On 28/10/2019 11:49, Brian Candler wrote:
>
> Many, many thanks for this - I will be compiling it shortly.

I see you already made a binary release of pulsarctl, so even better :-)

Comment 1: I find the CLI doesn't follow the Java pulsar-admin CLI.

# pulsar-admin version
$ apache-pulsar-2.4.1/bin/pulsar-admin topics subscriptions 
persistent://public/default/my-topic
my-subscription
first-subscription

# pulsarctl version
$ ./pulsarctl subscriptions list persistent://public/default/my-topic
+--------------------+
|   SUBSCRIPTIONS    |
+--------------------+
| my-subscription    |
| first-subscription |
+--------------------+

I now have a new set of commands to learn - although maybe I'll just 
forget the Java ones going forward.

Comment 2: I can't see a way to disable the table formatting, e.g. to 
get just the raw list of subscriptions in the example above.  This would 
be useful for simple scripting.  An option to return all tables as csv 
or tsv would be nice.  (Ditto for clusters list, brokers list)

JSON would be another option, especially since some commands already 
give JSON output (e.g. topic lookup, topic stats)

Comment 3: There is a newline missing after the command output here:

ubuntu@pulsar:~$ ./pulsarctl topic compact-status public/default/my-topic
Compacting the topic persistent://public/default/my-topic is not 
runningubuntu@pulsar:~$

But this is a great start, thanks again!

Regards,

Brian.


Re: Pulsar go admin client and pulsarctl

Posted by Brian Candler <b....@pobox.com>.
On 28/10/2019 11:01, Jinfeng Huang wrote:
> Could you share with the community about how to use Pulsarctl in details?

There is comprehensive documentation in the linked webpage:

https://streamnative.io/docs/pulsarctl/v0.1.0/

Many, many thanks for this - I will be compiling it shortly. Waiting 4 
or 5 seconds for the Java CLI to start up on every invocation is a real 
pain point!

I can't see that it has an equivalent for pulsar-client produce/consume 
- but that is only useful for quick-and-dirty testing anyway.

Cheers,

Brian.


$ time bin/pulsar-admin topics list
Main parameters are required ("tenant/namespace
")

Get the list of topics under a namespace.
Usage: list [options] tenant/namespace



real    0m3.676s
user    0m5.941s
sys    0m0.339s


Re: Pulsar go admin client and pulsarctl

Posted by Jinfeng Huang <hj...@streamnative.io>.
Great job!
Could you share with the community about how to use Pulsarctl in details?

Best Regards,
Jennifer


On Mon, Oct 28, 2019 at 6:35 PM Yong Zhang <zh...@gmail.com>
wrote:

> Hi Pulsar community,
>
> We just open sourced a Pulsar go admin client library and a CLI tool
> `pulsarctl` built on top of it. If you are writing Golong applications to
> interact with Pulsar, definitely check this out!
>
> https://github.com/streamnative/pulsarctl
>
> pulsarctl command reference:
> https://streamnative.io/docs/pulsarctl/v0.1.0/
>
> If you have any questions, feel free to ping us!  Contributions are
> welcome!
>
> Thanks,
>
>
> —
>
> Yong,
> Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by Yuva raj <uv...@gmail.com>.
This is so awesome. Thanks for sharing streamnative team

On Mon, Oct 28, 2019, 4:05 PM Yong Zhang <zh...@gmail.com> wrote:

> Hi Pulsar community,
>
> We just open sourced a Pulsar go admin client library and a CLI tool
> `pulsarctl` built on top of it. If you are writing Golong applications to
> interact with Pulsar, definitely check this out!
>
> https://github.com/streamnative/pulsarctl
>
> pulsarctl command reference:
> https://streamnative.io/docs/pulsarctl/v0.1.0/
>
> If you have any questions, feel free to ping us!  Contributions are
> welcome!
>
> Thanks,
>
>
> —
>
> Yong,
> Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by Guangning E <eg...@gmail.com>.
Great job.
It is really much faster than the java version of pulsar-admin.

Thanks,
Guangning

lan.liang <li...@163.com> 于2019年10月28日周一 下午8:01写道:

>
>
> It's really exciting news!
>
>
>
>
>
>
> - lan.liang
> On 10/28/2019 18:29,Yong Zhang<zh...@gmail.com> wrote:
> Hi Pulsar community,
>
> We just open sourced a Pulsar go admin client library and a CLI tool
> `pulsarctl` built on top of it. If you are writing Golong applications to
> interact with Pulsar, definitely check this out!
>
> https://github.com/streamnative/pulsarctl
>
> pulsarctl command reference:
> https://streamnative.io/docs/pulsarctl/v0.1.0/
>
> If you have any questions, feel free to ping us!  Contributions are
> welcome!
>
> Thanks,
>
>
> —
>
> Yong,
> Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by "lan.liang" <li...@163.com>.

It's really exciting news!






- lan.liang
On 10/28/2019 18:29,Yong Zhang<zh...@gmail.com> wrote:
Hi Pulsar community,

We just open sourced a Pulsar go admin client library and a CLI tool `pulsarctl` built on top of it. If you are writing Golong applications to interact with Pulsar, definitely check this out!

https://github.com/streamnative/pulsarctl

pulsarctl command reference:  https://streamnative.io/docs/pulsarctl/v0.1.0/

If you have any questions, feel free to ping us!  Contributions are welcome!

Thanks,


—

Yong,
Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by Yuva raj <uv...@gmail.com>.
This is so awesome. Thanks for sharing streamnative team

On Mon, Oct 28, 2019, 4:05 PM Yong Zhang <zh...@gmail.com> wrote:

> Hi Pulsar community,
>
> We just open sourced a Pulsar go admin client library and a CLI tool
> `pulsarctl` built on top of it. If you are writing Golong applications to
> interact with Pulsar, definitely check this out!
>
> https://github.com/streamnative/pulsarctl
>
> pulsarctl command reference:
> https://streamnative.io/docs/pulsarctl/v0.1.0/
>
> If you have any questions, feel free to ping us!  Contributions are
> welcome!
>
> Thanks,
>
>
> —
>
> Yong,
> Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by Jinfeng Huang <hj...@streamnative.io>.
Great job!
Could you share with the community about how to use Pulsarctl in details?

Best Regards,
Jennifer


On Mon, Oct 28, 2019 at 6:35 PM Yong Zhang <zh...@gmail.com>
wrote:

> Hi Pulsar community,
>
> We just open sourced a Pulsar go admin client library and a CLI tool
> `pulsarctl` built on top of it. If you are writing Golong applications to
> interact with Pulsar, definitely check this out!
>
> https://github.com/streamnative/pulsarctl
>
> pulsarctl command reference:
> https://streamnative.io/docs/pulsarctl/v0.1.0/
>
> If you have any questions, feel free to ping us!  Contributions are
> welcome!
>
> Thanks,
>
>
> —
>
> Yong,
> Best Regard,

Re: Pulsar go admin client and pulsarctl

Posted by xiaolong ran <ra...@gmail.com>.
Use pulsar-admin:

```
bin/pulsar-admin topics list public/default  4.63s user 0.26s system 211% cpu 2.309 total
```

Use pulsarctl:

```
./pulsarctl topics list public/default  0.01s user 0.01s system 34% cpu 0.079 total
```

This is so fast.

> 在 2019年10月28日,下午6:29,Yong Zhang <zh...@gmail.com> 写道:
> 
> Hi Pulsar community,
> 
> We just open sourced a Pulsar go admin client library and a CLI tool `pulsarctl` built on top of it. If you are writing Golong applications to interact with Pulsar, definitely check this out! 
> 
> https://github.com/streamnative/pulsarctl
> 
> pulsarctl command reference:  https://streamnative.io/docs/pulsarctl/v0.1.0/
> 
> If you have any questions, feel free to ping us!  Contributions are welcome!
> 
> Thanks,
> 
> 
> —
> 
> Yong,
> Best Regard,