8000 GitHub - kendarorg/the-protocol-master-samples: Real Life test for The Protocol Master: Python, Java, Go and .NetCore on Docker
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Real Life test for The Protocol Master: Python, Java, Go and .NetCore on Docker

License

Notifications You must be signed in to change notification settings

kendarorg/the-protocol-master-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Protocol Master Sample

Table of Contents

These are simple environments to test The Protocol Master application. We will mock without a line of code the database and a rest api of a simple TODO web application.

  • The documentation for the protocol master is here

If you like it Buy me a coffee :)

paypal


Prerequisites

  • A Docker environment
  • The Docker environment address (let's use DOCKER_SERVER for now)

Machine Dependant Stuffs! Beware

All .NET applications run out of the box only on Intel architecture, that means

  • Platform: linux/amd64
  • Target Architecture: amd64

For Apple M processors should work the following, change the HttpServer and RestServer dockerfile according to your needs (see on Microsoft for further info on the subject)

  • Platform: linux/arm64
  • Target Architecture: arm64

Simple TOD 8000 O app (mysql,http,.NET)

(Thanks patrick-baker for the UI!)

If you have Intellij or know what are *.http files you can configure this setting the myhost variable to DOCKER_SERVER

Startup

  • Clone the repo https://github.com/kendarorg/the-protocol-master-samples.git
  • Configure your browser to use DOCKER_SERVER:29000 as HTTP/S Proxy
  • Navigate to the "net-core" directory
  • Run docker-compose up to generate the environment
  • Several containers will be created
    • net-core-tpm: The Protocol Master server
    • net-core-mysql: The mysql database
    • net-core-http: The web-ui
    • net-core-rest: The rest back-end
  • Download the SSL certificate from http://net-core-tpm:8081/api/protocols/http-01/plugins/ssl-plugin/der and install it as a trusted root certificate

You can check now the application navigating (in the proxied browser) to anything you want, and you will se the calls flowing on the console.

You can even try the application on http://net-core-http/index.html but for the sake of simplicity please delete all tasks before continuing the tutorial

Recording

Look Ma, NO DATABASE

Look Ma, NOT EVEN THE API SERVER

Simple quotes app (java,mysql,mqtt)

If you have Intellij or know what are *.http files you can configure this setting the myhost variable to DOCKER_SERVER

You can check the quotations going to http:\\java-rest\index.html

Startup

  • Clone the repo https://github.com/kendarorg/the-protocol-master-samples.git
  • Configure your browser to use DOCKER_SERVER:29000 as HTTP/S Proxy
  • Navigate to the "java" directory
  • Run docker-compose up to generate the environment
  • Several containers will be created
    • java-tpm: The Protocol Master server
    • java-mysql: The mysql database
    • java-mosquitto: The mqtt broker
    • java-rest: The application reading mqtt messages (and showing on APIs)
    • java-quote-generator: The quote generation (every 10 seconds random stock quotes)
  • Download the SSL certificate from http://java-tpm:8081/api/protocols/http-01/plugins/ssl-plugin/der and install it as a trusted root certificate
  • Connect your mysql ui to DOCKER_HOST:23306 and use the database db

Now your environment is ready for a real test!

Recording

Look Ma, NO BROKER

Faking a message

{
  "contentType": "text/plain",
  "body": "{ \"symbol\" : \"META\", \"date\" : [UNIXTIMESTAMP]999,\"price\" : 1000,  \"volume\" : 1000\n }"
}
  • Look on your message on the graph!

Simple quotes app (python,mysql,amqp)

If you have Intellij or know what are *.http files you can configure this setting the myhost variable to DOCKER_SERVER

You can check the quotations going to http:\\py-rest\index.html

Startup

  • Clone the repo https://github.com/kendarorg/the-protocol-master-samples.git
  • Configure your browser to use DOCKER_SERVER:29000 as HTTP/S Proxy
  • Navigate to the "python" directory
  • Run docker-compose up to generate the environment
  • Several containers will be created
    • py-tpm: The Protocol Master server
    • py-mysql: The mysql database
    • py-rabbit: The amqp broker
    • py-rest: The application reading mqtt messages (and showing on APIs)
    • py-quote-generator: The quote generation (every 10 seconds random stock quotes)
  • Download the SSL certificate from http://py-tpm:8081/api/protocols/http-01/plugins/ssl-plugin/der and install it as a trusted root certificate
  • Connect your mysql ui to DOCKER_HOST:23306 and use the database db

Now your environment is ready for a real test!

Recording

Look Ma, NO BROKER

Golang Chat app (golang, postgres, redis)

Startup

  • Clone the repo https://github.com/kendarorg/the-protocol-master-samples.git
  • Configure your browser to use DOCKER_SERVER:29000 as HTTP/S Proxy
  • Navigate to the "golang" directory
  • Run docker-compose up to generate the environment
  • Several containers will be created
    • go-tpm: The Protocol Master server
    • go-postgres: The postgres database
    • go-redis: The Redis server
    • go-rest: The chat application
  • Download the SSL certificate from http://go-tpm:8081/api/protocols/http-01/plugins/ssl-plugin/der and install it as a trusted root certificate
  • Connect your postgres ui to DOCKER_HOST:25432 and use the database db

Now your environment is ready for a real test!

Recording

Look Ma, NO BROKER

Fake messaging

  • Open the message sending API
  • Insert the following
    • connectionId: -1 (all the subscribed)
    • channel: common
    • Request body
{
  "contentType": "text/plain",
  "body": "fake: message"
}
  • Look on your message on the chat!
0