Showing posts from January, 2020

A Simple gRPC CRUD Example with Java

This is in continuation of the my previous post on gRPC with Java . This post shares a simple and complete gRPC CRUD example with Java. You can find the complete source here: The following APIs are exposed by the gRPC server used in this example: rpc createDepartment (Department) returns (Department) {}; rpc updateDepartment (Department) returns (Department) {}; rpc findDepartmentsByFilter(DepartmentFilter) returns (DepartmentList) {}; rpc deleteDepartment(google.protobuf.Int64Value) returns (google.protobuf.Empty) {}; rpc findDepartmentById (google.protobuf.Int64Value) returns (Department) {}; rpc findAllDepartments(google.protobuf.Empty) returns (stream Department) {}; rpc updateDepartmentsInBatch(stream Department) returns (stream Department){}; The   has the detailed steps for running the example. Enjoy !

Building Server APIs Using gRPC for a Java Application

Sometime back I blogged about core projects under  the  Cloud Native Computing Foundation: . It is time for us to revisit some of the core projects in detail to learn how to fit them in a real life cloud native application. In this post I will briefly touch one of the promising projects incubating under Cloud Native Computing Foundation:  gRPC What is gRPC ? The gRPC is  remote procedure call (RPC) framework and toolset developed at Google. This is built on top of HTTP/2, leveraging the the benefits of a platform independence of the HTTP. It essentially means that this protocol works with various programming languages :) Here is the definition from  wikipedia : gRPC (gRPC Remote Procedure Calls) is an open source remote procedure call (RPC) system initially developed at Google in 2015. It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authe

Git in Day to Day Life

Here is the quick list of commands that one need to use in day to day life. As I keep forgetting them, thought of listing down in one place.  Hopefully this list may save my time ;) Configuring your identity  $ git config --global "FirstName LastName" $ git config --global Clone repository $ git clone Create new branch $ git  checkout -b feature/branch-name Staging and committing changes $ git  add . $ git  commit -m "comments" $ git push -u origin feature/branch-name Viewing git log $ git log --after="2020-01-01 00:00" $ git log --all --pretty=format:"%h %cd %s (%an)" --since=7.days $ git log --all --pretty=format:"%h %cd %s (%an)" --since='7 days ago' Rebasing a feature branch $ git checkout master $ git pull $ git checkout feature/branch-name $ git rebase master $ git add $ git rebase --continue $ git rebase master $ git push origin fe

Integrating Kafka with a Helidon MicroProfile Application - Part 2

Recently I posted a very short article on using Kafka along with a Helidon MicroProfile application: . It was using classic Kafka APIs and involved more manual coding. In this post, let us see how to build the same messaging solution declaratively availing the Reactive Messaging offering of MicroProfile  specification. Uhh...Did I say less coding and more fun :) What is MicroProfile Reactive Messaging? The following doc may answer all your questions:  Another interesting blog post on this topic is here: . We use the same constructs with a Helidon MP application in this example. What is the usecase exercised in this example ? It is simple :) We use the a simple greeting REST API  to exercise the Kafka messaging feature. When a client updates the greeting message, the Greeting re

Integrating Kafka with a Helidon MicroProfile Application - Part1

The Apache Kafka has become an industry defacto standard for  all messaging use cases that you may find today for an enterprise application.  In this short post I am sharing a simple application that show cases classic integration of Kafka APIs with a Helidon MicroProfile application. You can checkout the source form here: What is the usecase exercised in this example ? It is simple :) We use the a simple greeting REST API  to exercise the Kafka messaging feature. When a client updates the greeting message, the Greeting resource implementation will publish the new greeting message to Kafka topic for use by interested parties(consumers) Who does what? Here is quick summary of the classes that you find in the source: ClassicKafkaMessageConsumer : This class contains the logic for listening to the Kafka topic. This class uses a custom annotation '@Startup' so that it gets instantiated on application start up. The

A Glance at the Cloud Native Computing Foundation and it's Core Projects

This article talks about Cloud Native Computing Foundation(CNCF) and core projects under CNCF. What is Cloud Native Computing Foundation ? Let us take a baby step and try to see things in simple terms. In earlier days applications are built and deployed on specific production environment that run on popular OS such as Linux or windows. We used to set these OS specific environment properties as runtime config parameters to the application. As the cloud development became a norm, people started thinking about better ways to decouple runtime environment from the application codebase resulting in evolution of Docker containers. If an application’s functionality is split in to multiple docker containers as microservices, then orchestration of these containers became another nightmare. Later Kubernetes came in to picture to mange multiple docker containers that forms an application and orchestration. These two innovations along with other tools around them made it possible to port app