Using Spring HTTP Exchange Interfaces to access REST services

Spring’s HTTP Exchange Interfaces

This video is from June 25, 2023. The idea is to discuss the HTTP Exchange Interfaces REST clients in Spring 6.

Here is the generated summary of the video, in five bullet points, generated by the YouTube Summary plugin from Glasp, which works with ChatGPT (emphasis added):

  • The video discusses Dan Vega‘s work on HTTP Interfaces in Spring Boot 3.0, which simplifies the creation of web clients by only requiring the definition of interface methods.
  • The service used for demo purposes is JSON Placeholder, a free fake API that supports all major HTTP verbs like GET, POST, PUT, PATCH, and DELETE. It is especially useful for testing and prototyping.
  • The presenter shows how to test these HTTP interfaces using Spring Boot’s test framework, specifically Webflux Starter and web test client. The video also briefly mentions a solution for a DNS warning on macOS with Apple Silicon.
  • There’s a discussion about how Spring Boot 3.1.1 can make use of Java records, which are immutable data holders. The video shows the compatibility with Spring’s built-in Jackson JSON parser.
  • The video ends by discussing error handling and suggests that while the HTTP Interfaces are a great addition, more work is needed for comprehensive error handling. Several viewers had asked about this topic in the comments on Dan Vega’s videos.

My goals for this video were (1) to talk about Spring’s HTTP exchange interfaces, (2) to experiment with the JsonPlaceholder service, (3) have fun with a theme, this one being the whole CSI / A Few Good Men crossover, and (4) leverage some viewers from my friend Dan Vega’s much more successful YouTube channel. 🙂

In that, it was moderately successful. The thumbnail is too busy and doesn’t communicate what’s going on, so I may still change that. Dan laughed, which was great. 🙂 The code in the repo works, which is fun, and I even managed to download each individual id in the dataset in parallel, which was seriously cool.

Anyway, if you have any interest in the topic, please enjoy the video.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Stuff I've learned recently...

Subscribe now to keep reading and get access to the full archive.

Continue reading