Code Monkey home page Code Monkey logo

pvent's Introduction

Pvent

Pvent is a CLI tool for sending events across different message brokers. At the moment, only Google Pub/Sub, Kafka, Amazon SQS and RabbitMQ are supported.

Installation

To install Pvent using homebrew, you can run the following commands:

brew tap dotunj/tools
brew install dotunj/tools/pvent

You can also check the releases section to download the binary for your OS.

Getting Started

To get started with using Pvent, you need to provide your message brokers credentials in a config file.

An example pvent.json config file looks like:

{
  "type": "sqs",
  "sqs": {
    "access_key_id": "<access-key-id>",
    "secret_access_key": "<secret-access-key>",
    "region": "<region>",
    "queue_name": "<queue-name>"
  },
  "kafka": {
    "address": "<address>",
    "topic": "<topic>",
    "auth": {
      "tls": true,
      "type": "scram",
      "hash": "SHA256",
      "username": "<username>",
      "password": "<password>"
    }
  },
  "google": {
    "project_id": "<project-id>",
    "topic_name": "<topic-name>"
  },
  "rabbitmq": {
    "dsn": "<dsn>",
    "queue_name": "<queue-name>"
  }
}

Using the CLI, you can now run:

pvent dispatch --target payload.json --rate 1

If you're using Google Pub/Sub, you'll need to expose the path to your service account credentials file as an environment variable

export GOOGLE_APPLICATION_CREDENTIALS="/Users/dotunj/Documents/certs/service.json" 

CLI Usage Manual

Usage: pvent <command> [command flags]

dispatch command:
  - type string
        Message Brokers Type (sqs, google, kafka, rabbitmq)
  - rate int
        Total number of events to send
  - target string
        Path to JSON payload to dispatch
  - config
       Path to Pvent config file

License

The MIT License (MIT). Please see License File for more information.

pvent's People

Contributors

dotunj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pvent's Issues

Add integration tests

My idea for integration testing is to spin up the actual message brokers (Kafka, RabbitMQ) or use an emulator (SQS, Google Pub/Sub) and verify we can publish to them without any errors.

How can we assert these messages were delivered?

Deprecate support for passing brokers credentials via CLI flags

It's better to use environment variables or the config file to pass in the credentials for the different message brokers.

  1. The code for maintaining this is quite cumbersome at the moment and will only get worse over time as we add more message brokers except a refactor is done. See here
  2. From a UX perspective, I also think it's easier to define your credentials once in a config file, as opposed to always specifying the credentials via the CLI.

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.