Giter Club home page Giter Club logo

felipegutierrez / bidding-system-java Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 473 KB

This is a bidding system implemented using Java 11 with Spring-webflux and the project-reactor. The project uses spring-actuator and micrometer to expose metrics to Prometheus and visualize them in Grafana. Prometheus alertmanager, nodeexporter, and blackbox are also configured with multiple rules w.r.t. the service and the host system.

Shell 13.62% Java 85.27% Dockerfile 1.11%
spring-boot spring-webflux junit5 project-reactor prometheus micrometer grafana spring-actuator prometheus-alertmanager docker-compose

bidding-system-java's People

Contributors

codacy-badger avatar felipegutierrez avatar

Watchers

 avatar

bidding-system-java's Issues

Configure metrics

Configure metrics using spring boot actuator + micrometer + Prometheus

running the script ./run-test.sh fails eventually due to a duplicate bid of different offers.

running ./run-test.sh fails eventually

$ ./run-test.sh 
--- result	2021-05-04 14:39:18.545379451 +0200
+++ expected.result	2021-05-03 12:24:52.327669639 +0200
@@ -1,11 +1,11 @@
 a:750
 c:2500
 c:5000
-b:750
+a:750
 b:1250
 c:2500
 c:6000
-c:1000
+b:1000
 a:750
 c:500
 c:1000

This is because both bidders b:750 and a:750 are bidding 750:

felipe@alreadytaken:~/workspace-idea/bidding-system-java$ curl -s "http://localhost:8080/4?a=5&b=3"; echo
a:750
felipe@alreadytaken:~/workspace-idea/bidding-system-java$ curl -s "http://localhost:8080/4?a=5&b=3"; echo
b:750

and the application takes the first. Check the logs:

2021-05-04 14:39:58.107  INFO 51455 --- [     parallel-3] BidResponse                              : request(256)
2021-05-04 14:39:58.111  INFO 51455 --- [r-http-epoll-10] BidResponse                              : onNext(BidResponse(id=4, bid=750, content=b:$price$))
2021-05-04 14:39:58.111  INFO 51455 --- [r-http-epoll-12] BidResponse                              : onNext(BidResponse(id=4, bid=750, content=a:$price$))
2021-05-04 14:39:58.111  INFO 51455 --- [r-http-epoll-11] BidResponse                              : onNext(BidResponse(id=4, bid=500, content=c:$price$))
2021-05-04 14:39:58.112  INFO 51455 --- [r-http-epoll-10] BidResponse                              : onComplete()
2021-05-04 14:39:58.112  INFO 51455 --- [r-http-epoll-12] BidResponse                              : onComplete()
2021-05-04 14:39:58.112  INFO 51455 --- [r-http-epoll-11] BidResponse                              : onComplete()
2021-05-04 14:40:00.250  INFO 51455 --- [or-http-epoll-5] o.g.f.b.a.handler.AuctionHandlerFunc     : received bid request with adID: 4 attributes: {a=[5], b=[3]}
2021-05-04 14:40:00.250  INFO 51455 --- [     parallel-1] BidResponse                              : onSubscribe(FluxOnErrorResume.ResumeSubscriber)
2021-05-04 14:40:00.251  INFO 51455 --- [     parallel-1] BidResponse                              : request(256)
2021-05-04 14:40:00.251  INFO 51455 --- [     parallel-2] BidResponse                              : onSubscribe(FluxOnErrorResume.ResumeSubscriber)
2021-05-04 14:40:00.251  INFO 51455 --- [     parallel-2] BidResponse                              : request(256)
2021-05-04 14:40:00.251  INFO 51455 --- [     parallel-3] BidResponse                              : onSubscribe(FluxOnErrorResume.ResumeSubscriber)
2021-05-04 14:40:00.251  INFO 51455 --- [     parallel-3] BidResponse                              : request(256)
2021-05-04 14:40:00.254  INFO 51455 --- [r-http-epoll-12] BidResponse                              : onNext(BidResponse(id=4, bid=750, content=a:$price$))
2021-05-04 14:40:00.255  INFO 51455 --- [r-http-epoll-12] BidResponse                              : onComplete()
2021-05-04 14:40:00.255  INFO 51455 --- [r-http-epoll-10] BidResponse                              : onNext(BidResponse(id=4, bid=750, content=b:$price$))
2021-05-04 14:40:00.255  INFO 51455 --- [r-http-epoll-11] BidResponse                              : onNext(BidResponse(id=4, bid=500, content=c:$price$))

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.