Typically to use the @Transactional annotation in Spring Boot, you must configure transaction management. However, unless you are explicitly configuring a Global Transaction or deploying your application to a Java EE Application server , then the default is Local Transaction Management. Global Transaction Management When a JTA environment is detected, Spring’s JtaTransactionManager is used to manage transactions.ContinueContinue reading “Integration Testing JMS @Transactional with Embedded ActiveMQ”
Author Archives: Susan Mustafa
JDK 17 and jaxb2-maven-plugin:
This article will not cover Jakarta XML Binding, v3.0 https://jakarta.ee/specifications/xml-binding/3.0/ The jaxb2-maven-plugin used in the example below is for JAXB <=2.x . There is a fork which is meant to support JAXB 3.0 (Jakarta)When using Jakarta XML Binding, all binding.xjb and schema definitions using the http://java.sun.com namespace need to change to use https://jakarta.ee/xml/ns/jaxb instead. AnyContinueContinue reading “JDK 17 and jaxb2-maven-plugin:”
JDK 17 and maven-jaxb2-plugin
This article will not cover Jakarta XML Binding, v3.0 https://jakarta.ee/specifications/xml-binding/3.0/ The maven-jaxb2-plugin used in the example below is for JAXB <=2.x . There is a fork of the JAXB2 Maven Plugin from phax/maven-jaxb2-plugin, which is itself a fork on highsource/maven-jaxb2-plugin. The fork is meant to support JAXB 3.0 (Jakarta)When using Jakarta XML Binding, all binding.xjb and schemaContinueContinue reading “JDK 17 and maven-jaxb2-plugin”
Jaxb Bindings for java.time (LocalDate, LocalDateTime)
If you deal with legacy applications, especially those handling XML JMS messages, then at one point you will encounter the xml DataTypes (date/datetime).As java.util.Date and java.util.Calender are considered legacy; we should aim to use java.time package instead. For that we need to override the specified default bindings of XML Schema built-in datatypes by customizing JAXBContinueContinue reading “Jaxb Bindings for java.time (LocalDate, LocalDateTime)”
Create GraphQL Api using GraphQL Modules and Apollo Server
We will cover the topic of creating a GraphQL API having a REST API as its data source. For this we decided to use TypeScript, GraphQL Modules and Apollo-Server. If you wanted to create a GraphQL API in Java, you have that option as well using Springboot/Java GraphQL. As we started to develop GraphQL schemas,ContinueContinue reading “Create GraphQL Api using GraphQL Modules and Apollo Server”
Java 11 HttpClient and cookies
The HTTP Client was introduced in Java 11. It can be used to request HTTP resources over the network. It supports HTTP/1.1 and HTTP/2, both synchronous and asynchronous programming models, handles request and response bodies as reactive-streams, and follows the familiar builder pattern.https://openjdk.java.net/groups/net/httpclient/intro.htmlRecently we had a requirement of setting an authentication session cookie and we hadContinueContinue reading “Java 11 HttpClient and cookies”
Migrating to Thorntail 2.7
Thorntail 2.7 has reached end of life and it is recommended you migrate to Quarkus or WildFly. This however might not be possible for your organization. You could have many applications using an older version of Thorntail and the effort to migrate to Quarkus could be expensive. In such a case, you could upgrade theContinueContinue reading “Migrating to Thorntail 2.7”
Microprofile Dynamic Rest Client
In Microprofile, using the @RegisterRestClient annotation requires that you define either a baseURI as part of the annotation, or defined in the application properties file. However such definition is static and if you need to change it during runtime, you wont be able to do it as part of the annotation. You could create aContinueContinue reading “Microprofile Dynamic Rest Client”
Integration Testing with Springboot and Test Containers (LocalStack, MongoDb, ActiveMQ)
In this post we will cover Integration Testing for the application we created in the previous post. For the Integration Tests, we will use Test Containers running in docker, to ensure that we try and connect with real services instead of mocking them. Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwawayContinueContinue reading “Integration Testing with Springboot and Test Containers (LocalStack, MongoDb, ActiveMQ)”
Springboot with JMS, Amazon MQ, MongoDB, S3 and Thymeleaf
In this post, we will create a simple spring boot application that will act as both the JMS Producer and Consumer. It will connect to Amazon MQ on AWS, Send/Receive JMS Messages, Store User information in MongoDb, Create a PDF file for a given User and upload it to AWS S3. Note: In a productionContinueContinue reading “Springboot with JMS, Amazon MQ, MongoDB, S3 and Thymeleaf”