2024-04-01

  • Reactive Programming: Reactive programming is a programming paradigm that promotes an asynchronous, non-blocking, event driven approach to data processing. Let us understand the difference between blocking and non blocking request processing.

  • Blocking and Non blocking nature of API’s

  • Backpressure: Controlling the rate limit of events being published to the subscriber from the publisher side, without crashing the system.

Spring Boot with Webflux

  • spring-boot-starter-data-r2dbc: need of r2dbc due to blocking nature of jdbc, JDBC cannot be used in reactive programming, hence reactive relational database connectivity arised, which helps to connect relational databases to webflux.

  • jasync-r2dbc-mysql is a dependency for reactive support for MySQL, is an async, netty based JVM database driver.

  • schema.sql: within the classpath,which should be located in /src/main/resources because r2dbc doesn’t support hibernate,i.e the automatic creation of tables within the database

  • Repository layer: extending the R2dbcRepository which in turn extends the ReactiveCrudRepository.

  • Difference between Mono and Flux.

Testing API’s with curl

  • POST operation:
$ curl -d '{
    "tutorialId": 5,
    "title": "breathe_become_air",
    "description": "kalanithi"
}' -H 'Content-Type: application/json' http://localhost:8080/tutorials
  • GET operation:
 curl -v http://localhost:8080/tutorials/5

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /tutorials/5 HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.87.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 89
<
{ [89 bytes data]
100    89  100    89    0     0   6098      0 --:--:-- --:--:-- --:--:--  6357{"tutorialId":5,"title":"breathe_become_air","description":"kalanithi","published":false}
* Connection #0 to host localhost left intact

which fetches the details.

Debian

  • debNuX is the changelog version format for stable where ‘+’ or ‘~’ is appended depending on the package ‘N’ is the major version of Debian, ‘X’ is a number, starting at 1, that is increased for each stable upload of this package.

  • For stable updates that use the same upstream version debian revision component will end in +debNuX

  • For stable updates that use the new upstream version debian revision component will end in ~debNuX

  • “Urgency” filed in the changelog is choosed based on the upload which fixes the RC bug,usual upload, or critical bugs. urgency=low: Usual upload, with britney transition from unstable to testing in 10days urgency=medium: RC Bug fixes, with britney transition in 5days urgency=high: fixes security bugs and 2 days for transition.