<commit_before># amqptap

Sometimes it is difficult to know what goes on in your RabbitMQ exchanges. `amqptap` is a CLI tool written in node.js that helps you get a better look at the messages that get passed around!

[repo]: https://github.com/tedeh/amqptap
[amqplib-repo]: https://github.com/squaremo/amqp.node
[travis]: https://travis-ci.org/tedeh/amqptap
[travis-img]: https://travis-ci.org/tedeh/amqptap.png?branch=master
[rabbitmq-url]: https://www.rabbitmq.com/uri-spec.html

[![Build Status][travis-img]][travis] 

## Installation

Install amqptap with `npm install -g` and you should have the `amqptap` executable accessible in your `PATH`.

## Usage

For a list of all options run `amqptap --help`.

`amqptap` creates an exclusive queue that is bound to the specified exchange, and will receive all messages on that exchange without interfering with other bound queues.

The server URL is specified using the `-s` or `--server` flag set to a value that corresponds to the [RabbitMQ URI specification][rabbitmq-url].

Almost feature-complete URL for connecting to `foo.bar` using port 1234, vhost `baz`, username `tester` and password `password`: `amqp://tester:password@foo.bar:1234/baz`

Without a specific server set, `amqptap` attempts to connect to a RabbitMQ server running on localhost using the guest account.

### Picking fields from the result

Given a raw message output (see "Automatic deserialization") from [amqplib][amqplib-repo] coming on `amq.topic` with routing key `foo.bar` that looks like this.

````javascript
{
  "fields": {
    "consumerTag": "amq.ctag-NFOFYLaMHMzMXD4PwHuLog",
    "deliveryTag": 1,
    "redelivered": false,
    "exchange": "amq.topic",
    "routingKey": "foo.bar"<commit_msg>Add npm badge<commit_after># amqptap

Sometimes it is difficult to know what goes on in your RabbitMQ exchanges. `amqptap` is a CLI tool written in node.js that helps you get a better look at the messages that get passed around!

[repo]: https://github.com/tedeh/amqptap
[amqplib-repo]: https://github.com/squaremo/amqp.node
[amqptap-npm]: https://www.npmjs.com/package/amqptap
[amqptap-travis]: https://travis-ci.org/tedeh/amqptap
[rabbitmq-url]: https://www.rabbitmq.com/uri-spec.html
[badge-travis]: https://img.shields.io/travis/tedeh/amqptap/master.svg?style=flat-square
[badge-npm]: https://img.shields.io/npm/v/amqptap.svg?style=flat-square

[![travis build status][travis-img]][amqptap-travis] 
[![npm][badge-npm]][amqptap-npm]

## Installation

Install amqptap with `npm install -g` and you should have the `amqptap` executable accessible in your `PATH`.

## Usage

For a list of all options run `amqptap --help`.

`amqptap` creates an exclusive queue that is bound to the specified exchange, and will receive all messages on that exchange without interfering with other bound queues.

The server URL is specified using the `-s` or `--server` flag set to a value that corresponds to the [RabbitMQ URI specification][rabbitmq-url].

Almost feature-complete URL for connecting to `foo.bar` using port 1234, vhost `baz`, username `tester` and password `password`: `amqp://tester:password@foo.bar:1234/baz`

Without a specific server set, `amqptap` attempts to connect to a RabbitMQ server running on localhost using the guest account.

### Picking fields from the result

Given a raw message output (see "Automatic deserialization") from [amqplib][amqplib-repo] coming on `amq.topic` with routing key `foo.bar` that looks like this.

````javascript
{
  "fields": {
    "consumerTag": "amq.ctag-NFOFYLaMHMzMXD4PwHuLog",
    "deliveryTag": 1,
    "redelivered": false,
    "exchange": "amq.topic",
    "routingKey": "foo.bar"
{'fraction_non_alphanumeric': 0.11734135667396062, 'fraction_numerical': 0.005470459518599562, 'mean_word_length': 4.687402799377916, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1578209', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1195, 'n_words': 409}