Reddit API Authentication with Java/Spring

Reddit API Authentication with Java/Spring

I am a big fan of Reddit. The platform is great for learning and sharing programming knowledge… In fact, it contains so much knowledge and opinion, that there is no chance for any single person to analyze it all. Sounds like a job for a machine? Before we get started, we need to learn how to authenticate with the Reddit API. Public read-only API with JSON Reddit has a very friendly API, with multiple endpoints being simply accessible in a JSON format after adding .json to the request. For example to get a list of Java topics discussed on the /r/Java subreddit, as a human you would go to https://www.reddit.com/r/java and you would see something like that: ...

November 4, 2018 · 4 min · Bartosz Jedrzejewski
Should you use Spring Boot in your project?

Should you use Spring Boot in your project?

Spring Boot is enjoying, a seemingly never-ending growth of popularity. While only released in 2014, it has managed to overtake the Java serverside in less than five years. When starting a new project, a sensible question to ask is- “should I use a Spring Boot?”. In this article, I will help you answer this question! Every project is different, but we can use some characteristics with which we can compare them. Based on these characteristics I will advise you if Spring Boot is generally a good idea. ...

September 24, 2018 · 4 min · Bartosz Jedrzejewski
Java vs Groovy for Microservices

Java vs Groovy for Microservices

In the past three years, I was involved in developing microservices architectures. In Java, with Spring Boot and in Groovy with Grails. Perhaps risking some outrage, I will compare my experience in Java and Groovy, Spring Boot and Grails and give my opinion on what works best. I will start looking purely at languages, as Spring Boot will work happily with Groovy and Java alike. What I like in Java-based microservices ...

August 26, 2018 · 5 min · Bartosz Jedrzejewski
Spring Boot - Best Practices

Spring Boot - Best Practices

Spring Boot is the most popular Java framework for developing microservices. In this article, I will share with you the best practices for working with Spring Boot that I have gathered by using it in professional development since 2016. I base these on my personal experience and writings of recognized Spring Boot experts. In this article, I focus on practices specific to Spring Boot (most of the time, also applicable to Spring projects). If you want to learn about the Java best practices, I recommend “Effective Java” which I review in a separate article. ...

August 6, 2018 · 8 min · Bartosz Jedrzejewski
Using Redis in Microservices Architecture

Using Redis in Microservices Architecture

In this article, we will look closer at a fascinating open source project. Meet Redis! You may be familiar with Redis already, in that case, you may be interested in the different use cases it has for microservices architecture. Read on to see how this “in-memory data structure store, database, cache, and message broker” can make your system better! What is Redis? I already revealed that in the introduction. To repeat (using redis.io own words): ...

August 3, 2018 · 5 min · Bartosz Jedrzejewski
The Quest for Simplicity in Java Microservices

The Quest for Simplicity in Java Microservices

There is great value in simplicity. When things are simple, they are easier to understand, easier to extend and easier to modify. They are better. Simplicity is the ultimate compliment you can give to an architecture or a framework. In this article, I look at how four different frameworks- Spring Boot, Javalin, Vert.x and Micronaut; approach this quest for simplicity. Simple does not mean easy One of my inspirations for this article was a great presentation by Rich Hickey titles Simple Made Easy. ...

July 8, 2018 · 7 min · Bartosz Jedrzejewski
CIA World Factbook API with Functional Spring

CIA World Factbook API with Functional Spring

I have recently been very interested in microframeworks. One thing notably missing from that article is Spring in the context of a microframework. You may be surprised, but it is possible to write very lightweight APIs with Functional Spring. In this article, I will show you how, by turning CIA World Factbook into a REST API. So what is Functional Spring? Functional Web Framework was introduced in Spring 5 and lets you build a very lightweight REST API without much of the Spring Magic. Sounds perfect! ...

June 22, 2018 · 5 min · Bartosz Jedrzejewski
WebFlux in practice - asynchronous service with WebClient

WebFlux in practice - asynchronous service with WebClient

Building reactive microservices with WebFlux is fun and easy. In this article, I will show you how to build a reactive “synonyms” service. Making asynchronous API calls with WebClient is likely the most common scenario for a real-life reactive microservice. Synonyms service – the idea I want to build a service that will return a synonym for a given word. Based on that I would like this service to translate a sentence into another one made completely out of synonyms. For example, I will have: Java is a good languagebecome Coffee is a right speech. It is somewhat entertaining and a nice example! ...

May 31, 2018 · 4 min · Bartosz Jedrzejewski
Getting Started with Kafka in Spring Boot

Getting Started with Kafka in Spring Boot

Kafka seems to only be gaining in popularity. A few years ago you could mostly see it in Big Data engineering context. These days, Kafka is starting to power more common message-oriented architectures. In this article, I want to give you a basic introduction to working with Spring Boot and Kafka. Installing Kafka on your machine One common barrier to entry for people to hack around on their machines with Kafka is how tricky the installation can be. For that very reason, I have written “How to easily run Kafka with Docker for development”– I think you will find it especially useful if you are on Windows! ...

May 21, 2018 · 3 min · Bartosz Jedrzejewski
The State of Spring in 2018 - Devoxx UK Impressions

The State of Spring in 2018 - Devoxx UK Impressions

Thanks to my company – Scott Logic – I recently had a pleasure of attending the Devoxx UK 2018 conference. Among many interesting talks and speakers, there were quite a few Spring celebrities present. Juergen Holler (Father of Spring), Josh Long and Mark Heckler were all there. Here are my impressions from the conference. Spring is hugely popular This is hardly news for anyone interested in microservices, but the popularity of Spring can’t be overstated. Every Spring talk was full and the audience was very engaged. Spring is very much the bread and butter of Server Side Java in 2018. ...

May 20, 2018 · 4 min · Bartosz Jedrzejewski