Quick Look: java.util.stream Examples

Keith Shakib Java, Technology Snapshot, Tutorial Leave a Comment

Some of us take for granted the newer features in Java, but, being a software consultant, I get to be involved in projects that are sometimes constrained to older versions of Java. The features from Java 1.8 that I have enjoyed for a few years are brand new to others.

I wrote this blog as a primer for those who are just getting started using java.util.Stream classes, or for those who haven’t had a chance to take a look at them until now. The quick topics below represent just a sampling of some of the ways to be more productive using java stream classes. Rather than providing a tutorial on how the classes are used, I’ll attempt to explain by example.

An Antlr4-Based Expression Parser

Lou Mauget Java, Programming, Technology Snapshot Leave a Comment

In this blog, we’ll present a simple arithmetic expression parser implemented through an Antlr4 parser generator. It will be able to take in an input string (such as 2+4+-4+-2*10%9*7) to produce the result (-12.0).

You may be thinking, “Great, but what’s the point?” Well, to answer your question, as simple as this example may seem, the principles involved actually extend to use cases such as DSLs, transpilation, and anything else expressible by grammar rules.

This post has two parts. In part 1, we’ll discuss the background components of a parser. In part 2, we’ll cover building the demo and running it. If you already understand grammar parsing, you could skip part one.

Transferring Spring Batch Apps to AWS Cloud

Rik Scarborough AWS, Cloud, Spring, Spring Batch, Technology Snapshot, Tutorial Leave a Comment

The last few years have seen a lot of movement to bring applications that don’t require manual intervention from the mainframe to Unix, Linux, Windows servers, or even to the desktop. This concept is commonly known as batch programming, and Spring Batch has been the tool many of us are using to accomplish this. Another trend that is gaining steam is to move from an internally-hosted server to a cloud-hosted system.

In this post, we discuss multiple ways for transferring Spring Batch applications up to the AWS Cloud, including EC2, Docker, Lambda, and others. I concentrate on AWS in this post, but, from my experience in Google Cloud, the same ideas will apply…

January 16: Behavior-Driven Development Talk @ KC Java

Keyhole Software Community, Company News, Educational Event, Java Leave a Comment

The Keyhole Software team is excited to announce that we are sponsoring and speaking at the upcoming Kansas City Java User Group on Thursday, January 16th.

Keyhole’s Keith Shakib will lead the January meetup of the monthly educational user group with the topic of Behavior-Driven Development in Practice. Attendance is free and dinner will be provided by Keyhole.

Thursday, January 16, 2020
5:30 PM to 7:30 PM
YRC Worldwide – 10990 Roe Ave Overland Park, KS

Centralizing Configurations with Spring Cloud Config

Bing Liu Microservices, Spring Boot, Technology Snapshot Leave a Comment

When the Microservices approach became popular a few years ago, many companies rushed to build their own microservices or to convert their legacy applications into microservices. Over the years, companies have implemented an abundance of microservices, mostly with Spring Boot. Each of them manage their own configurations across deployment environments like Dev, Test, and Prod.

Due to the nature of a complex business process, there are many common configurations (e.g. databases, queues, email servers, and FTP servers, etc.) used in the distributed services. This can result in services having redundant and confusing configs on a distributed system. It can become challenging to update the configs for too many services on a distributed system across multiple environments.

Thankfully, Spring Cloud Config provides the implementation to successfully resolve these issues. It provides server-side and client-side support for externalized configuration in a distributed system. With the Config Server, you have a central place to manage external properties for applications across all environments. The concepts on both client and server map identically to the Spring Environment and PropertySource abstractions, so they fit very well with Spring applications.

In this post, I’ll demonstrate Config Server and Client with example code. I’ll show you how to use Git or a local repository as a central place to store all the config files. The diagram below illustrates how the distributed client services (e.g. Investment Position/Price/Reporting Data service) fetch their configuration from the Config Server, which in turn retrieves them from one central place.