Coder Social home page Coder Social logo

engelmi / gim Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 64 KB

A sidecar implementation for consuming and producing SQS messages

Home Page: https://hub.docker.com/r/engelmic/gim

License: GNU General Public License v3.0

Dockerfile 1.35% Go 98.45% Makefile 0.21%
go golang sqs sidecar docker kubernetes k8s messaging

gim's Introduction

gim - Gophers In the Middle

License: GPL v3 Build Status

A sidecar implementation built on top of go-sqs intended to provide HTTP Endpoints for sending messages to and receiving them from AWS-SQS queues, which can be called by the main application inside a pod.

Usage

As standalone

docker run -p <host-port>:<gim-producer-port> \
  -e GIMCONFIG=<config-string> \
  -e AWS_ACCESS_KEY_ID='foo' \
  -e AWS_SECRET_ACCESS_KEY='bar' \
  engelmic/gim

Where <config-string> contains the configuration for all consumer and producer as well as the logger. The config definition can be seen in pkg/config/gim.go and examples/config/sample.json contains an example configuration.

As a sidecar

An example on how to use gim as a sidecar can be seen here.

Features

Consume

alt text

The consume routine of the gim sidecar looks roughly like this:

  1. listen for and collect batches of messages in the queue
  2. forward each message to the application
  3. process the message
  4. the application responds either with status code 200 for successfully processing the message or any other status code if it failed processing it
  5. on status code 200, gim removes the message from the queue and, otherwise, leaves the message in the queue for re-consumption

Produce

alt text

The produce routine of the gim sidecar looks roughly like this:

  1. the application sends a POST /<name-of-producer>/produce request to gim
  2. gim pushes the message to the specified queue
  3. on success, gim responds with status code 201 and, otherwise, with 500

gim's People

Contributors

engelmi avatar

Watchers

 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.