Pete Moore: This week I’ve written a pulse client in... |
This week I’ve written a pulse client in go:
I’ve also put together a command line interface to the go pulse client:
pulse-go
pulse-go is a very simple command line utility that allows you to specify a list of Pulse
exchanges/routing keys that you wish to bind to, and prints the body of the Pulse messages
to standard out.
_ Derivation of username, password and AMQP server url_
====================================================
If no AMQP server is specified, production will be used (amqps://pulse.mozilla.org:5671).
_ If a pulse username is specified on the command line, it will be used._
Otherwise, if the AMQP server url is provided and contains a username, it will be used.
Otherwise, if a value is set in the environment variable PULSE_USERNAME, it will be used.
Otherwise the value ‘guest’ will be used.
_ If a pulse password is specified on the command line, it will be used._
Otherwise, if the AMQP server url is provided and contains a password, it will be used.
Otherwise, if a value is set in the environment variable PULSE_PASSWORD, it will be used.
Otherwise the value ‘guest’ will be used.
_ Usage:_
pulse-go [-u ] [-p ] [-s ] (
pulse-go -h | —help
_ Options:_
-h, —help Display this help text.
-u The pulse user to connect with (see http://pulse.mozilla.org/).
-p The password to use for connecting to pulse.
-s The full amqp/amqps url to use for connecting to the pulse server.
_ Examples:_
_ 1) pulse-go -u pmoore_test1 -p potato123 _
_ exchange/build/ ‘#’ _
exchange/taskcluster-queue/v1/task-defined ‘....*.null-provisioner.buildbot-try.#’
_ This would display all messages from exchange exchange/build/ and only messages from_
exchange/taskcluster-queue/v1/task-defined with provisionerId = “null-provisioner” and
workerType = “buildbot-try” (see http://docs.taskcluster.net/queue/exchanges/#taskDefined
for more information).
_ Remember to quote your routing key strings on the command line, so they are not_
interpreted by your shell!
_ Please note if you are interacting with taskcluster exchanges, please consider using one_
of the following libraries, for better handling:
_ * https://github.com/petemoore/taskcluster-client-go_
* https://github.com/taskcluster/taskcluster-client
_ 2) pulse-go -s amqps://admin:peanuts@localhost:5671 exchange/treeherder/v2/new-result-set ‘#’_
_ This would match all messages on the given exchange, published to the local AMQP service_
running on localhost. Notice that the user and password are given as part of the url.
I’m currently frantically writing docs for it, so that it will be useful for others.
Additionally I’ve been writing a Task Cluster Pulse client which sits on top of the generic pulse client, and knows about Task Cluster exchanges and routing keys.
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |