Coder Social home page Coder Social logo

slaveofcode / nsqtracer Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 1.0 87 KB

Simple NSQ tracer tool to see any messages that being published to specific NSQ topic

License: MIT License

Go 86.87% Shell 13.13%
nsq nsqd nsqlookup cli cli-tool cli-utilities

nsqtracer's Introduction

NSQTracer

Simple NSQ tracer tool to see any messages that being published to specific NSQ topic. This library will not consume the message, only listening for new messages and display, that's it. However it also can consume the message by providing --auto-finish option, so the message will be assumed as finished.

Installation

Simply go to the latest binary release page to download the binary, and then run via CLI command. or if you has Go installed locally, NSQTracer can be installed via go install

Tips: Place the binary on /usr/local/bin (for *nix users) so it accessible anywhere in your system.

$ go install github.com/slaveofcode/nsqtracer

Start from default address

$ ./nsqtracer --topic SOMETOPIC

The command above will start a tracer listening from default nsqd host address, which is located on localhost:4151.

Start from specific address

If you want to use specific address of NSQd, you can attach more options like below

$ ./nsqtracer --topic SOMETOPIC --nsqd-tcp localhost:4180

Start from multiple address

NSQTracer is able to listen from multiple nsqd addresses, so you can watch through all nsqd instances. Simply add more on the --nsqd-tcp options.

$ ./nsqtracer --topic SOMETOPIC --nsqd-tcp localhost:4150 --nsqd-tcp localhost:4140 --nsqd-tcp localhost:4180

Using NSQLookupd address

By using nsqlookupd host address you'll discover all nsqd's that connected to the nsqlookupd instance, it's really helpful when you want to listen from all nsqd's by supplying only one nsqlookupd http address.

$ ./nsqtracer --topic SOMETOPIC --nsqlookup-http localhost:4161

The same rule applies for the --nsqlookup-http option, you can also provide more than one nsqlookupd addresses.

Read Available Options

Just run ./nsqtracer --help to see all available commands

LICENSE

MIT License

Copyright (c) 2020 Aditya Kresna

nsqtracer's People

Contributors

mschneider82 avatar slaveofcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mschneider82

nsqtracer's Issues

Provide flag for outputting only raw data, not meta data

The lines like this:

โžœ [my.topic.name] [05 Nov 21 09:23 CDT] [Published Msg]

are getting in the way of parsing data that comes out. For instance, I want to use jq utility to parse the JSON messages I have but I first have to filter out the lines mentioned above. I do this with grep -v "โžœ" but it's a bit of a hack. A flag to turn this off would be great.

(Thanks for this great tool!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.