Giter Site home page Giter Site logo

springcloud_example's Introduction

Spring Cloud

MessageQueue

Rabbitmq

docker run -d \
  --name rabbitmq \
  --network ecommerce-network \
  -p 5672:5672 \
  -p 15672:15672 \
  -p 4369:4369 \
  -e RABBITMQ_DEFAULT_USER=guest \
  -e RABBITMQ_DEFAULT_PASS=guest \
  rabbitmq:management

Kafka

# Zookeeper, Kafka
./bin/zookeeper-server-start.sh ./config/zookeeper.properties
./bin/kafka-server-start.sh ./config/server.properties

 # Check topics
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --list

Confluent

pwd: /confluent-7.3.0

./bin/connect-distributed ./etc/kafka/connect-distributed.properties
  • Connector
echo '
{
"name" : "my-source-connect",
"config" : {
  "connector.class" : "io.confluent.connect.jdbc.JdbcSourceConnector",
  "connection.url":"jdbc:mysql://localhost:3306/mydb",
  "connection.user":"root",
  "connection.password":"pass",
  "mode": "incrementing",
  "incrementing.column.name" : "id",
  "table.whitelist":"users",
  "topic.prefix" : "my_topic_",
  "tasks.max" : "1"
	}
}
' | curl -X POST -d @- http://localhost:8083/connectors --header "content-Type:application/json"
  • Sink Connect
echo '
{
"name":"my-sink-connect",
"config":{
    "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector",
    "connection.url":"jdbc:mysql://localhost:3306/mydb",
    "connection.user":"root",
    "connection.password":"pass",
    "auto.create":"true",
    "auto.evolve":"true",
    "delete.enabled":"false",
    "tasks.max":"1",
    "topics":"my_topic_users"
  }
}
'| curl -X POST -d @- http://localhost:8083/connectors --header "content-Type:application/json"
  • Order Sink Connect
echo '
{
"name": "my-order-sink-connect",
"config": {
    "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector",
    "connection.url": "jdbc:mysql://localhost:3306/mydb",
    "connection.user": "root",
    "connection.password": "pass",
    "auto.create": "true",
    "auto.evolve": "true",
    "delete.enabled": "false",
    "tasks.max": "1",
    "topics": "orders"
  }
}
'| curl -X POST -d @- http://localhost:8083/connectors --header "content-Type:application/json"

Monitoring

Zipkin

docker run -d -p 9411:9411 \
  --network ecommerce-network \
  --name zipkin \
  openzipkin/zipkin

Prometheus

docker run -d -p 9090:9090 \
  --network ecommerce-network \
  --name prometheus \
  -v /Users/shane/Documents/GitHub/springcloud_example/prometheus.yml:/etc/prometheus/prometheus.yml \
  prom/prometheus

Grafana

docker run -d -p 3000:3000 \
--network ecommerce-network \
--name grafana \
grafana/grafana
  • id : admin

  • pass: admin

  1. Add Datasource

configuration - add datasource - prometheus

  1. Add Dashboard
  • JVM: Dashboard - Import - ID: 4701 - LOAD
  • Prometheus: Dashboard - Import - ID: 3663 - LOAD
  • Spring Cloud Gateway: ID 11506 - LOAD
  1. Change Metric broswer in Spring Cloud Gateway Dashboard

Total Request Served -> Edit

  • Before : sum(gateway_requests_seconds_count{job=~"$gatewayService"})

  • After: sum(spring_cloud_gateway_requests_seconds_count{job=~"apigateway-service"})

If it shows N/A , change legend option to Custom

Total Successful Requests Served -> Edit

  • Before: sum(gateway_requests_seconds_count{outcome="SUCCESSFUL", job=~"$gatewayService"})
  • After: sum(spring_cloud_gateway_requests_seconds_count{outcome="SUCCESSFUL", job=~"apigateway-service"})

Total Unsuccessful Requests Served

  • Before: sum(gateway_requests_seconds_count{outcome!="SUCCESSFUL", job=~"$gatewayService"})
  • After: sum(spring_cloud_gateway_requests_seconds_count{outcome!="SUCCESSFUL", job=~"apigateway-service"})

Successful Api Calls

  • After : spring_cloud_gateway_requests_seconds_count{outcome="SUCCESSFUL", routeId=~"user-service", job=~"apigateway-service"}

springcloud_example's People

Contributors

shanepark avatar

Stargazers

Arsalan Yaqoob Malik avatar Jefferson Martines avatar JaeWang Lee avatar

Watchers

Kostas Georgiou avatar  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.