Image for post
Image for post

This post is a looong overdue follow-up of a sort to my previous post on the config API: https://medium.com/@pubuduf/ballerina-config-api-f6a9c455267b. The config API went through a major refactoring for the Ballerina 0.970.0 release. With the new type system which was introduced for the 0.970.0 version, retrieving configurations using the then API became cumbersome. There were instances where 5–10 line functions had to be written to read a single config value in the required data type (e.g., retrieving a port number as an integer). To address this, a new comprehensive API was introduced. …


Ballerina 0.970.0 introduced HTTP caching support. It does so by adding a caching layer on top of the plain HTTP client in Ballerina. The caching layer, complies with the RFC 7234 specification (it is not a complete implementation of the spec though). In addition to this, APIs are also provided for handling caching at the server side. In this post, we’ll take a look at the client side of caching using Ballerina 0.975.0.

Prerequisites

  • Some familiarity with Ballerina language (syntax, services, endpoints). The Ballerina by Example page would be a good place to start.
  • HTTP caching (basic understanding of how it works. This excellent article from Google would do…


Edit: This post is now heavily out-of-date with the newer versions of Ballerina. Please refer to the following post for up-to-date info: https://medium.com/@pubuduf/configuration-management-in-ballerina-b952cae80c49

Ballerina has been around for a few months now. It has come a long way since its launch back in February, constantly tweaking, improving and adding things based on user feedback.

Image for post
Image for post

Ballerina strives to be configuration-free as much as possible in order to make it hassle free for the user. But inevitably, there will be instances where you need to be able to feed in configurations dynamically, rather than hard coding it. To address this we added a config API to Ballerina. The API is two-fold: one gives an API to the Ballerina user which will allow the user to feed in configurations from various sources. The other is for the developer who needs to take user configurations into account when developing new features. In this post, I’ll be focusing on the user level API which is available in the ballerina.config …

About

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store