The NEW API Pattern

Distributed Architectures are a lot like neural networks; all services that talk to each other need to share the I/O in and in a way that they can synchronize that information on the fly. The way the brain does is that each neuron that communicates with another has the other neuron fire back a neurotransmitter to synchronize and improve that communication in the future thus creating a pattern.

While this behavior is almost identical to what is known as a webhook in the API world, we do not follow the same principles for API design in distributed architectures. Since the API Pattern designed in the 1970’s for centralized architectures and NOT distributed architectures, it was never intended to be used in this way and creates an architectural cross-cutting concern when used in distributed services.

Continue reading “The NEW API Pattern”

Share

Handling Exception Scenarios in REST API developed using JAX-RS

Prerequisite: Hands on Knowledge of REST API Development using JAX-RS.

REST Services has been an integral part of complex enterprise applications for several years. Developers generally prefer two APIs listed below for building REST API in their enterprise applications.

  1. JAX-RS – Part of JEE Specification with different implementations like RestEasy, Jersey, Restlet etc.
  2. Spring Boot  An OpenSource Spring Community Project best suited for Microservices-based applications.

In this Article, we will learn how to handle Exceptions gracefully in Rest APIs which are built using JAX-RS.

Continue reading “Handling Exception Scenarios in REST API developed using JAX-RS”

Share

Know how RESTful your API is: An Overview of the Richardson Maturity Model

Most of the time, I see developers are bit confused about the term REST. For some enterprise application developers, the meaning of REST is JSON i.e. if they are using JSON in their application, which means they working on REST API, which is not true to some extent. Let’s take a look what exactly a REST API is.

Continue reading “Know how RESTful your API is: An Overview of the Richardson Maturity Model”

Share

Testing REST APIs with REST Assured

Note: This is an updated version of a post I wrote for my private blog years ago.

While working on the REST API of RHQ a long time ago, I had started writing some integration tests against it. Doing this via pure HTTP calls is very tedious and brittle. So, I was looking for a testing framework to help me and found one that I used for some time. I tried to enhance it a bit to better suit my needs but didn’t really get it to work.

I started searching again and this time found REST Assured, which is almost perfect as it provides a high-level fluent Java API to write tests. REST Assured can be used with the classic test runners like JUnit or TestNG.

Continue reading “Testing REST APIs with REST Assured”

Share

The Camel Rest DSL

Camel

Apache Camel is a piece of JBoss Fuse.  It is an open source integration framework with a variety of components to fit your integration needs.  Camel is a Java-based implementation of the Enterprise Integration Patterns based on a book by Gregor Hohpe and Bobby Woolf.  Camel includes components for HTTP, Files, FTP, JMS, JDBC, AWS, and much more.  While Camel can be used for many different purposes, this post will focus on the REST DSL specifically.

Continue reading “The Camel Rest DSL”

Share

The Hardest Part About Microservices: Your Data

Continuing on with my series about microservices implementations (see “Why Microservices Should Be Event Driven”, “Three things to make your microservices more resilient”, “Carving the Java EE Monolith: Prefer Verticals, not Layers” for background) we’re going to explore probably the hardest problem when creating and developing microservices. Your data. Using Spring Boot/Dropwizard/Docker doesn’t mean you’re doing microservices. Taking a hard look at your domain and your data will help you get to microservices.

Continue reading The Hardest Part About Microservices: Your Data

Share