Git Product home page Git Product logo

rppc's Introduction

Rabbitmq Ping Pong Client

The rabbitmq ping pong client provides a small service to check the connectivity of your rabbitmq instance.

Overview

The application itself is split into three parts:

  • sender
  • receiver
  • metrics

Message Structure

Each message is build with the same structure: message-$EPOCHTIMESENDER-$EPOCHTIMERECEIVER. This provides an easy approach to check if there is a high delay between your sender and receiver which may point towards a slow running rabbitmq and full queues in your environment.

Sender

The sender is the initial component to send messages into a queue. It will generate a message with the current epoch time embedded and pushes it towards your configured rabbitmq instance. The configuration itself is done via environment variables.

Environment Configuration

client.mode: sender
rabbitmq.clientkeystorepassphase: ping-pong
rabbitmq.clientkeystorepath: /tmp/certs/client.p12
rabbitmq.host: YOUR_AWESOME_BROKER_URL
rabbitmq.password: YOUR_AWESOME_PASSWORD
rabbitmq.port: "5671"
rabbitmq.receiver.queue: ping-pong-receiver
rabbitmq.sender.queue: ping-pong-sender
rabbitmq.serverkeystorepassphase: ping-pong
rabbitmq.serverkeystorepath: /tmp/certs/serverks.jks
rabbitmq.useclientcert: "true"
rabbitmq.username: YOUR_AWESOME_USERNAME
rabbitmq.virtualhost: /

Receiver

The receiver is the second part of this application and will watch a configured queue in your rabbitmq and consume any message that gets put into. After receiving a message the receiver will put his own epoch time behind the already existing and push the message into the second queue. As already seen the configuration itself is done via environment variable and only differs in the client.mode set to receiver.

Environment Configuration

client.mode: receiver
rabbitmq.clientkeystorepassphase: ping-pong
rabbitmq.clientkeystorepath: /tmp/certs/client.p12
rabbitmq.host: YOUR_AWESOME_BROKER_URL
rabbitmq.password: YOUR_AWESOME_PASSWORD
rabbitmq.port: "5671"
rabbitmq.receiver.queue: ping-pong-receiver
rabbitmq.sender.queue: ping-pong-sender
rabbitmq.serverkeystorepassphase: ping-pong
rabbitmq.serverkeystorepath: /tmp/certs/serverks.jks
rabbitmq.useclientcert: "true"
rabbitmq.username: YOUR_AWESOME_USERNAME
rabbitmq.virtualhost: /

Metrics

The metrics component provides the final part of the rppc and does the evaluation of the passed-through message. It provides a prometheus endpoint with the metrics for rabbitmq_receiver_timestamp and rabbitmq_sender_timestamp as gauge. Based on these two epoch timestamps you should be able to calculate the time in milliseconds that passed by from sender to receiver. The environment configuration differs only for the client.mode in this example.

Environment Configuration

client.mode: metrics
rabbitmq.clientkeystorepassphase: ping-pong
rabbitmq.clientkeystorepath: /tmp/certs/client.p12
rabbitmq.host: YOUR_AWESOME_BROKER_URL
rabbitmq.password: YOUR_AWESOME_PASSWORD
rabbitmq.port: "5671"
rabbitmq.receiver.queue: ping-pong-receiver
rabbitmq.sender.queue: ping-pong-sender
rabbitmq.serverkeystorepassphase: ping-pong
rabbitmq.serverkeystorepath: /tmp/certs/serverks.jks
rabbitmq.useclientcert: "true"
rabbitmq.username: YOUR_AWESOME_USERNAME
rabbitmq.virtualhost: /

Setup

For a general purpose this repository provides a kustomize kubernetes deployment found under src/main/kubernetes. The setup is following the kustomize components setup and patches everything together based on your decisions withing the overlays. If you are not familiar with kustomize commponents I strongly advice you to take a quick detour towards the official documentation

/src/main/kubernetes
├── base
│   ├── deployment.yaml
│   ├── kustomization.yaml
│   └── service.yaml
├── components
│   ├── metrics
│   │   ├── configuration-metrics.yaml
│   │   ├── kustomization.yaml
│   │   └── patch-deployment.yaml
│   ├── receiver
│   │   ├── configuration-receiver.yaml
│   │   ├── kustomization.yaml
│   │   └── patch-deployment.yaml
│   └── sender
│       ├── configuration-sender.yaml
│       ├── kustomization.yaml
│       └── patch-deployment.yaml
├── overlay
│   ├── example_enterprise
│   │   ├── certificates
│   │   │   ├── client.p12
│   │   │   └── serverks.jks
│   │   ├── configuration-metrics.yaml
│   │   ├── configuration-receiver.yaml
│   │   ├── configuration-sender.yaml
│   │   ├── kustomization.yaml
│   │   └── servicemonitor.yaml
│   └── example_without_metrics
│       ├── certificates
│       │   ├── client.p12
│       │   └── serverks.jks
│       └── kustomization.yaml
└── README.md

rppc's People

Contributors

deb4sh avatar dependabot[bot] avatar

Watchers

 avatar  avatar

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.