Git Product home page Git Product logo

kedawithrabbitmqsample's Introduction

Keda with RabbitMq Example

.Net Core 3.1, RabbitMq, MediatR, Keda

Description

A simple docker container that will receive messages from a RabbitMQ queue and scale via KEDA. The reciever will receive a single message at a time (per instance), and sleep for 1 second to simulate performing work. When adding a massive amount of queue messages, KEDA will drive the container to scale out according to the event source (RabbitMQ).

More about Event driven scaling : Keda

Features

Framework
  • .Net Core

Requirements

  • .Net Core >= 3.1
  • Helm
  • Kubernetes cluster

Setup

This setup will go through creating a RabbitMQ queue on the cluster and deploying this consumer with the ScaledObject to scale via KEDA. If you already have RabbitMQ you can use your existing queues.

First you should clone the project:

git clone https://github.com/ozanerdogan90/KedaWithRabbitMQSample.git
cd KedaWithRabbitMQSample

Creating a RabbitMQ queue

cd deploy
run rabbitmq-install.sh

⚠️ Be sure to wait until the deployment has completed before continuing.

kubectl get po

NAME         READY   STATUS    RESTARTS   AGE
rabbitmq-0   1/1     Running   0          3m3s

Installing Keda to Kubernetes cluster

cd deploy
run keda-install.sh

Deploying a RabbitMQ consumer and producer

cd deploy
run run.sh

Creating load

hey -n 500 -c 500 -m POST -T "application/json"  -H "Content-Type: application/json"  "http://localhost:5000/orders" -d ""

this will create 500 items in RabbitMq

Validate the deployment scales

kubectl get deploy -w

kedawithrabbitmqsample's People

Stargazers

Oğuz Sert avatar

Watchers

James Cloos avatar ozan erdogan 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.