Home » Tag Archives: Kotlin

Tag Archives: Kotlin

Unit test for Spring’s WebClient

WebClient to quote its Java documentation is Spring Framework’sNon-blocking, reactive client to perform HTTP requests, exposing a fluent, reactive API over underlying HTTP client libraries such as Reactor Netty. In my current project I have been using WebClient extensively in making service to service calls and have found it to be an awesome API and I love its use of ...

Read More »

Augmenting a Spring Data repository through delegation

I have recently written several posts about Kotlin’s delegation. In doing so, I realised a useful way to apply it to Spring Data repositories. Which would allow Spring Data to continue sprinkling some magic while providing a route for customisation. The code shown in this post is in Kotlin, but is still relevant to Java. This post uses R2DBC, but ...

Read More »

Using DataBinding with Glide in Android

In this post on databinding, we’ll take a look at how to load images using databinding with glide in an imageview. Let me begin by saying that you don’t need custom imageviews for this. Using binding adapter to declare a custom attribute, we can easily load a remote image into imageview with databinding. I’ll be creating a sample project for ...

Read More »

Streaming live updates from a reactive Spring Data repository

This post details a naive implementation of streaming updates from a database to any other components that are interested in that data. More precisely, how to alter a Spring Data R2DBC repository to emit events to relevant subscribers. A little bit of background knowledge of R2DBC and Spring will be helpful for this post. My previous writings, Asynchronous RDBMS access ...

Read More »

How-To: Spring Boot 2 Web Application with Multiple Mongo Repositories and Kotlin

First of all, a disclaimer: if you’re writing a microservice (which everyone does now right?) and want it to be idiomatic, you don’t normally use several different data sources in it. Image taken from Pixabay © https://pixabay.com/illustrations/software-binary-system-1-0-binary-557616/ Why? Well, by definition, microservices should be loosely coupled, so that they can be independent. Having several microservices writing into the same database really ...

Read More »

Callback hell and Reactive patterns

One of the ways that I have better understood the usefulness of aReactive Streams based approach is how it simplifies a Non-blocking IO call. This post will be a quick walkthrough of the kind of code involved in making a synchronous remote call, then show how layering in Non-blocking IO though highly efficient in the use of resources(especially threads) introduces ...

Read More »

Extending and Overriding Flows from external CorDapps

Corda 4 was released last week (21st Feb) bringing with it a ton of new features to make Corda more enjoyable to work with. To be honest, I am kind of assuming there are a lot of new features. I had a quick browse through the changelog, mainly to see my contributions being referenced, but I remember seeing a lot ...

Read More »

Asynchronous RDBMS access with Spring Data R2DBC

spring-interview-questions-answers

Not too long ago, a reactive variant of the JDBC driver was released. Known as R2DBC. It allows data to be streamed asynchronously to any endpoints that have subscribed to it. Using a reactive driver like R2DBC together with Spring WebFlux allows you to write a full application that handles receiving and sending of data asynchronously. In this post, we ...

Read More »

Validating external data with an Oracle

I hang out in the Corda Slack channel quite a lot and try to answer questions when I can. A reasonable number of questions I have attempted to answer are related to Oracles. More specifically, when to use one. I feel like I can answer that, “Use an Oracle when you need to validate external data that can change frequently”. ...

Read More »