Home » Spring

Tag Archives: Spring

Receive Pub/Sub messages to your Spring Application

spring-interview-questions-answers

Pub/Sub is a messaging solution provided by GCP Before we dive into the actual configuration we need to be aware that Spring Cloud for GCP is now managed by the Google Cloud Team. Therefore the latest code can be found here. Our application will receive messages from Pub/Sub and expose them using an endpoint.Let’s go for the imports first <?xml ...

Read More »

Using R2DBC with a Reactor Application

spring-interview-questions-answers

Since Reactor has taken over the Java world it was inevitable the a reactive sql library would be there.In this blog we shall use r2dbc with h2 and reactor. We shall start with the dependencies needed. <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.2</version> </parent> <groupId>com.gkatzioura</groupId> <artifactId>r2dbc-reactor</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> ...

Read More »

Obtaining TLS Client Certificates In Spring Integration

java-interview-questions-answers

Spring Integration is a very powerful and extensible framework for, well, integrations. But sometimes it’s not trivial how to get some information that yo need. In my case – a certificate used for mutual authentication in a TLS (syslog over TLS) connection. You have a Java method that receives a Message and ideally you’d want to get the certificate chain ...

Read More »

Keeping track of requests and Responses on Spring WebFlux

spring-interview-questions-answers

In any rest-api based application it’s a matter of time when there is going to be the need to intercept the requests towards the application and execute more than one actions. If those actions, are actions that need to apply towards all requests to the application then the usage of filters makes sense, for example security. On Servlet based applications ...

Read More »

Coroutine based Spring boot webflux application

I have worked with Spring Framework for ages and it still manages to surprise me with how cutting edge it continues to be but at the same time enabling a developer to put together a fairly sane app. The most recent surprise was with how it enables programming a web application with Kotlin coroutines. Coroutines is a fairly complicated concept ...

Read More »

Upload files in Spring Boot application using Commons FileUpload

spring-interview-questions-answers

In our previous post, we saw how to upload a file using the Spring framework’s default implementation for MultipartFile interface. In this post, we will see how we can use the Commons FileUpload library and the wrapper implementation CommonsMultipartFile provided by the Spring framework. Update the pom.xml We will update the maven dependencies to include commons-io and commons-fileupload. We will ...

Read More »

Uploading files in Spring Boot application

spring-interview-questions-answers

Uploading files is one of the most common operations in a web application. In this article we will look at how to upload file from an HTML page and copy it to the file system on the server. Creating a HTML form with file upload option The below HTML code and its corresponding Javascript code creates the HTML form and ...

Read More »

Introduction into GraalVM (Community Edition): Cloud as a Changing Force

1. Introduction The shift towards cloud computing has had a massive impact on every single aspect of the software development process. In particular, the tools and frameworks the developers have had mastered for years suddenly became unfit, or to say it mildly, outdated. To reflect the reality, the whole new family of frameworks and libraries has emerged, collectively called cloud-native. ...

Read More »