Skip to content

HTTP server acting like an synchronous interface for asynchronous services.

License

Notifications You must be signed in to change notification settings

meero-com/hmb-proxy

Repository files navigation

HMB proxy

logo.png
Hold My Beer proxy


Abstract asynchronous processing and make it synchronous for your clients.

CI

Goal

The HMB proxy is made to allow under-the-hood, loosely coupled processing with parallel processing in mind.

Instead of having a "fire & forget", callback-supported asynchronous processing, customers can rely on simple HTTP calls while having all the benefits of async processing.

Using a timeout / retry / exponential back-off strategy, users can completely abstract the implementation complexity of asynchronous systems.

logo.png

Usage

$ export GIN_MODE=release
$ hmb-proxy --env=prod
2025/02/19 15:33:01 sqs: map[destination_queue:output-queue source_queue:input-queue]
2025/02/19 15:33:01 aws: map[access_key_id:default endpoint_url:http://localstack:4566/ region:eu-west-1 secret_access_key:default]
2025/02/19 15:33:01 env: prod
2025/02/19 15:33:01 server: map[port:8080]

You can then forward requests to the proxy using curl.

A dummy-service is available in ./dummy-service to try out the loosely coupling mechanism locally.

Alternatively, the repository contains a ./e2e script to manually simulate a backend service.

This project is not Production-ready as of now. Feel free to use it, give your feedback and to help us improve it !

Build

This project supports packaging through container images.

The proxy can be built using the following command:

$ docker build -t hmb-proxy:local .

It can then be run locally using:

$ docker run -it --rm hmb-proxy:local

Development

The repository offers different utilities to improve development.

Compose setup

A docker-compose.yml manifest is available in the top-level directory to emulate AWS services using localstack.

$ docker compose up -d --wait
[+] Running 2/2
 ✔ Container hmb-proxy-hmb-proxy-1   Healthy  1.8s
 ✔ Container hmb-proxy-localstack-1  Healthy  6.8s

Glossary

  • Project name: HMB proxy
  • Reference to the executable: hmb-proxy