Spring Data JPA: Emitting events on save() – Kotlin Edition

kotlin and spring boot

Scenario In a nutshell, we'd like to emit an event or take some custom action whenever a Spring Data JPA repository gets it's "save(...)" method called. Our criteria is to have minimal constraints set on other developers using this. In other words, we wouldn't like a solution where we create a new method or change … Continue reading Spring Data JPA: Emitting events on save() – Kotlin Edition

Advertisements

Part 2 – Inspired by Gatsby.js : Rolling your own GraphQL powered WordPress API (this time with Spring Boot)

In the first part of this two-article series, we explored rolling your own WordPress GraphQL adapter, inspired by the work done by GatsbyJS, written in Javascript and hosted on GraphCool. In this article, we'll build the same thing, this time using Java. Spring Boot and GraphQL Java Kickstart make this quite easy. Pre-requisites For anyone … Continue reading Part 2 – Inspired by Gatsby.js : Rolling your own GraphQL powered WordPress API (this time with Spring Boot)

Nugget Post: How I remember the distinction between the JPA / Spring Data annotations of ManyToOne vs OneToMany

I find the below mental map (and example) easy to remember and to reason about the distinctions between @ManyToOne and @OneToMany in the context of Java JPA / Spring Data applications For a larger image download my original one here: https://docs.google.com/drawings/d/e/2PACX-1vSW7PyvGLhRWTa84vhFb9qnhP3lKu1WyUZthKGssh3W2-xnANgAiucfaFnLpF9svfT_Fuo6LwE6UqY0/pub?w=1443&h=966

First steps in writing a custom OWASP ZAP extension

OWASP ZAP is a very popular attack proxy typically used in Web Application penetration tests. Think "Open Source BurpSuite", and that's ZAP in a nutshell. It has become my go-to tool for penetration tests, and it definitely is a fantastic piece of software that ticks all my boxes - except one. The problem : Note taking … Continue reading First steps in writing a custom OWASP ZAP extension

Apache NiFi: Custom Web Scraper Processor – Powered by Selenium

In this article we explore how to build a custom Apache Nifi processor. Our objective is to build a custom NiFi processor, written in Java, that uses Selenium to scrape an arbitrary piece of information off a web-page. The end result will look like this: https://www.youtube.com/watch?v=alRC8owgjl4&feature=youtu.be This highlights the flexibility of Apache NiFi, showing off … Continue reading Apache NiFi: Custom Web Scraper Processor – Powered by Selenium

Lessons learnt: Of Spring Boot + OAuth2 + redirect URIs

TL;DR: make sure NGINX is setup correctly (proxy_set_header) before messing around with your code. Scenario: Deploying a Spring Boot micro-service behind an NGINX reverse proxy gave us issues when using default Google OAuth2 configuration as described here , basically showing the "Redirect URI Mismatch" mentioned at the very end of the linked article Trying the solution based … Continue reading Lessons learnt: Of Spring Boot + OAuth2 + redirect URIs

Lessons learned: Spring Data Postgres application configuration

Scenario: During development of a Spring Boot application, with a PostgreSQL backend, we randomly observe errors such as: hikaripool-1 - connection is not available, request timed out after 30000ms   FATAL: remaining connection slots are reserved for non-replication superuser connections   Solution: There are a few checks to perform: Ensure that you use the correct … Continue reading Lessons learned: Spring Data Postgres application configuration