npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

amqp-tools

v1.2.2

Published

amqp cli tools

Downloads

8

Readme

amqp-tools

This package provides two CLI tools for interacting with a RabbitMQ server. You can consume (export) data from queues and/or exchanges into JSON. Also you can then publish (import) that JSON data.

When installed globally, the tools are exposed as amqp-consume and amqp-publish.

This application uses rc so you can save options. The most useful option would be your AMQP connection url. For example, you can create the file $HOME/.amqp-toolsrc with the content:

url=amqp://alibaba:[email protected]/Cave
indentation=2

The rest of this README is just the output from using the tools with --help.

Consume

amqp-consume

Consumes AMQP messages from Queues and Exchange+RoutingKey

Usage

amqp-consume [options] specification [specification...]

specification := queue|binding binding := exchange "/" route ("/" route)*

Options

-u, --url string URL of AMQP server -x, --max number maximum messages to consume --min number require minimum messages available to consume -i, --indentation number JSON output indentation -a, --ack acknowledge consumed messages -v, --verbose turn volume up to 11 -h, --help show help

Output

The output is a stream of JSON data, or an array of messages when indentation is used. The JSON data matches the output of amqplib, with some added friendly conversion of binary data and, when contentType is 'application/json', JSON parsing.

Examples

$ amqp-consume -x 10 -a my-queue

Consume and acknowledge 10 messages from queue named 'my-queue'.

$ amqp-consume amq.topic/# My-Exchange/my.routing.key my-queue

Consume all messages from exchange 'amq.topic', messages from exchange 'My- Exchange' matching the routing key 'my.routing.key', and also messages from queue named 'my-queue'. (Stop consuming on interrupt.)

Publish

amqp-publish

Publish JSON-based AMQP messages from STDIN (see amqp-consume) By default, published to original exchange+route from metadata, and additionally to specified queues or exchange+route

Usage

amqp-publish [options] [specification...]

Specification

specification := queue|binding binding := exchange "/" route ("/" route)*

Options

-u, --url string URL of AMQP server -n, --nometa ignore metadata when publishing (requires specs) -q, --queue use queue -- not exchange/route -- from metadata -v, --verbose turn volume up to 11 -h, --help show help

Examples

$ amqp-publish < saved-messages.json

Publish the saved messages to the exchange as they were consumed from, using the same routing key.

$ amqp-publish -n amq.topic/my.topic.routing.key < saved-messages.json

Ignore original message metadata, instead publish to exchange 'amq.topic' with routing key 'my.topic.routing.key'.

$ amqp-publish -q < saved-messages.json

Publish the saved messages directly to the same queue they were consumed from.

$ amqp-publish amq.topic/route.one/route.two < saved-messages.json

Publish the saved messages to original exchange+route, but additionally to exchange 'amq.topic' using both 'route.one' and 'route.two' routing keys.