The Wayback Machine - https://web.archive.org/web/20200921035854/https://github.com/EthosLending/MicroMesh
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Micromesh

This project is for a simple web micro service proxy that will log and route web service requests. The project is based on .NET Core.

Quick usage

The service comes pre-configured with DuckDuck and Postman services, so the easiest ways to test it is to run the mesh via one of the run scripts ./scripts/run.ps1 or ./scripts/run.sh and test it by sending a CURL request to post man.

Windows:

curl -uri http://127.0.0.1:54492/get?foo=bar -headers @{forward-to="postman"}

Mac:

curl -url http://127.0.0.1:54492/get?foo=bar -header "forward-to: postman"

Configuration

The project is built with a goal of being as lightweight as possible both on resources, maintenance and cognitive load.

For logging you can use the built in logging of .NET Core - if you know how to configure that log, you are good.

For service configuration all you need to do is add sections to appsettings.json. Each service has a pool of one or more pre-configured hosts to be selected at random when proxying requests.

  "Services": {
    "duckduck": [ 
      "http://api.duckduckgo.com:80",
      "https://api.duckduckgo.com:443",
      "api.duckduckgo.com"
    ],
    "postman": [ 
      "postman-echo.com"
    ]
  }
  "ConversationLogging": {
    "LoggingEnabled" : "true",
    "IncludedServices": [
      "foobar",
      "foobar-document"
    ]
  },
  "RetryPolicy": {
    "ExceptionRetryCount": "3",
    "StatusCodeRetryCounts": {
      "404": "1",
      "408": "1",
      "500": "1",
      "503": "3"
    }
  }

Routing traffic through the mesh.

You can run the mesh server on any port, and the clients of the mesh should direct the traffic to that IP/URL/Port with a host header that points to one of the configuration items.

Performance Tests

We tested Micromesh using two scenarios as follows:
Scenario 1: Sending 10,000 requests with a small JSON payload.
Scenario 2: Sending 1,000 requests with a payload containing an 827 Kb PDF file.
Below are the results for average request time.

Test Scenario Without Micromesh With Micromesh No Logging With Micromesh and Logging
Scenario 1 10ms 75ms 168ms
Scenario 2 40ms 100ms 347ms

About

a small service mesh implemented in .NET Core

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.