<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Norbert Nowak on Medium]]></title>
        <description><![CDATA[Stories by Norbert Nowak on Medium]]></description>
        <link>https://medium.com/@nonowak?source=rss-d5a1160c05d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*g9RXGqoSBkFuruAY</url>
            <title>Stories by Norbert Nowak on Medium</title>
            <link>https://medium.com/@nonowak?source=rss-d5a1160c05d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 16:46:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nonowak/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What’s new in Spring Boot 3.0]]></title>
            <link>https://medium.com/@nonowak/whats-new-in-spring-boot-3-0-bed0b3ed080f?source=rss-d5a1160c05d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bed0b3ed080f</guid>
            <category><![CDATA[jakarta]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[graalvm]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[spring-data]]></category>
            <dc:creator><![CDATA[Norbert Nowak]]></dc:creator>
            <pubDate>Sun, 29 Jan 2023 11:33:49 GMT</pubDate>
            <atom:updated>2023-01-29T11:33:49.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*6jXr9K8Vm-5P5VFymsrGlQ.png" /></figure><p>I know it has been a while since the Spring Boot 3.0 update on 24 November. However, there are a few features worth mentioning:</p><ul><li>Jakarta EE</li><li>GraalVM Native Images</li><li>Spring Data 2022</li><li>HTTP Interfaces</li><li>Observability</li><li>Problem Detail</li><li>Java 17 (quickly)</li></ul><h3>Jakarta EE</h3><p>Jakarta EE is a set of specifications. The specification is an umbrella term for a set of interfaces, abstract classes, types, etc. You can think of it as a library.</p><p>I’ve included a few examples below, and you can find a full list of specifications <a href="https://jakarta.ee/specifications/">here</a>.</p><ul><li>DB connection (previously javax.persistance, now jakarta.persistance)</li><li>Network communication (jakarta.servlet)</li><li>JSON Processing</li></ul><p>Example of imports in Spring 2.x and 3.x</p><pre>import javax.servlet.annotation.WebServlet;<br>import javax.servlet.http.HttpServlet;<br>import javax.servlet.http.HttpServletRequest;<br>import javax.servlet.http.HttpServletResponse;</pre><p>vs.</p><pre>import jakarta.servlet.annotation.WebServlet;<br>import jakarta.servlet.http.HttpServlet;<br>import jakarta.servlet.http.HttpServletRequest;<br>import jakarta.servlet.http.HttpServletResponse;</pre><p>In my opinion, this is a much more cosmetic change than a functional one. Of course, the project and dependencies will be cleaner.</p><h3>GraalVM Native Images</h3><p>GraalVM is basically another JDK distribution whose main advantages are:</p><ul><li>High-performance</li><li>AOT - Ahead-of-time compilation (bypass interpretation, precompiling only required classes)</li><li>Peak performance without warmup time</li><li>Multi-language support (Python, JS, Java, R…)</li></ul><p>Native Java means a program uses AOT compilation to produce an executable image. Such an image can run standalone, offering quick startup, low latency, and low CPU/memory requirements.</p><p>However, you need to be aware of the restrictions and <a href="https://www.graalvm.org/22.3/reference-manual/native-image/metadata/Compatibility/">compatibility guide</a>:</p><ul><li>Unreachable during image creation code will be removed</li><li>No lazy loading</li><li>Fixed classpath</li><li>@Profile annotation is not supported</li></ul><p>This feature can be very useful for deploying FaaS (Function as a Service) in the cloud. See if it fits into your application.</p><h3>Spring Data</h3><p>Main updates in Spring Data area:</p><ul><li>CRUD repository interfaces that return lists instead of iterators. You don’t need additional mapping anymore.</li><li>Consistent deletion method behavior across modules. <br>deleteById — should not throw an exception if no entity was deleted<br>delete — should throw <em>OptimisticLockingException</em> exception if nothing was deleted and the entity has a version property. Otherwise should not throw an exception.</li><li>Sorting repositories does not inherit from CRUD repositories as it was before</li><li>Removal of support Joda Time, ThreeTenBackport, RxJava 1 and 2</li></ul><h3>HTTP Interfaces</h3><p>Spring Boot 3 allows you to define HTTP interfaces as Java interfaces. Such interfaces have HTTP exchange methods. You can define a proxy that implements this interface to perform these exchanges. This feature requires a <a href="https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-webflux">WebFlux</a> dependency in your project.</p><p>In a nutshell interface declaration.</p><pre>interface ResourceService {<br><br>    @GetExchange(&quot;/resources/{resourceId}/&quot;)<br>    Resource getResource(@PathVariable String resourceId);<br><br>}</pre><p>@GetExchange can be replaced by any other HTTP method.<br>And a proxy implementation.</p><pre>WebClient client = WebClient.builder().baseUrl(&quot;https://resources.com&quot;).build();<br>HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();<br>ResourcesService service = factory.createClient(ResourcesService.class);</pre><p>So we have another way to communicate with an external API. Compared to e.g. RestTemplate, it may look cleaner at first glance. However, there is still a proxy to configure.</p><h3>Observability</h3><p>Observability consists of logging, tracing and metrics. <br>The metrics and tracing are the responsibility of <a href="https://micrometer.io/">Micrometer</a>, which is built into Spring Boot 3. You don’t need a third-party library like before.<br>In addition, the Micrometer <a href="https://micrometer.io/docs/observation">Observation API</a> allows you to define exactly which parts of your code should be traced.</p><h3>Problem Detail</h3><p>Have you ever implemented a custom error response object, used Spring Error Attributes, or even an external library like <a href="https://github.com/zalando/problem">Zalando Problem</a>?</p><p>Spring Boot 3 introduces a new object calledProblemDetail which is the implementation of <a href="https://www.rfc-editor.org/rfc/rfc7807">RFC-7807</a>. As described in the above document, it consists of the following parameters:</p><ul><li>type — URI redirection to the webpage which describes a problem type in human-readable format.</li><li>title — a quick human-readable summary of what happened</li><li>status — http status</li><li>detail — explanation of this particular problem</li><li>instance — URI of this particular request</li></ul><h3>Java 17</h3><p>The default Java version from now on will be Java 17. There are already a bunch of articles describing the new features, so don’t blame me, but I’m going to move on.</p><h4>Other Links</h4><ul><li><a href="https://jakarta.ee/">https://jakarta.ee/</a></li><li><a href="https://www.graalvm.org/">https://www.graalvm.org/</a></li><li><a href="https://spring.io/blog/2022/11/24/spring-boot-3-0-goes-ga">https://spring.io/blog/2022/11/24/spring-boot-3-0-goes-ga</a></li><li><a href="https://www.youtube.com/watch?v=TR254zh-f3c">https://www.youtube.com/watch?v=TR254zh-f3c</a></li><li><a href="https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes">https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes</a></li><li><a href="https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html">https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html</a></li><li><a href="https://docs.spring.io/spring-framework/docs/current/reference/html/integration.html#rest-http-interface">https://docs.spring.io/spring-framework/docs/current/reference/html/integration.html#rest-http-interface</a></li><li><a href="https://docs.spring.io/spring-boot/docs/current/api//org/springframework/boot/web/servlet/error/DefaultErrorAttributes.html">https://docs.spring.io/spring-boot/docs/current/api//org/springframework/boot/web/servlet/error/DefaultErrorAttributes.html</a></li><li><a href="https://www.rfc-editor.org/rfc/rfc7807">https://www.rfc-editor.org/rfc/rfc7807</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bed0b3ed080f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migration Guide from Spring Boot 1.5 to 2.2.x]]></title>
            <link>https://medium.com/rsq-technologies/migration-guide-from-spring-boot-1-5-to-2-2-x-3a87295630cc?source=rss-d5a1160c05d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a87295630cc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Norbert Nowak]]></dc:creator>
            <pubDate>Thu, 16 Apr 2020 06:23:45 GMT</pubDate>
            <atom:updated>2020-04-16T06:23:45.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsQpWumbWI1KpXjvrSrrEQ.jpeg" /></figure><h3>Hello!</h3><p>I am Norbert and I work at RSQ Technologies as a software developer. One of our main products is RSQ Health — a system that supports clinics, hospitals and doctors in their everyday work with online documentation, timetables and patient database. We also work on AI and hardware but these are not the topic of this article.</p><p>Let’s start with some project background.</p><p>Our core app is a monolith. There are also some helping microservices around it.</p><p>As you might guess — Yes, this article is about that core.</p><p>Spring Boot 1.5.6 was the latest version when we have started writing our monolith in 2017. It’s been a long time since then — numerous new versions of Spring Boot were released in the meantime.</p><p>Months were passing and we were adding new features, bug fixes etc… Nobody cared about the outdated Spring Boot until the moment I estimated that some tasks related to Hibernate update would take me (approximately) 1 hour. I found out it was related to an outdated dependency. But… digging deeper I noticed that this is not a problem of the dependency but the whole outdated Spring Boot. So I decided to start a conversation about the update. At our company, at one of our retrospective/planning weekly meetings I convinced my teammates that it is the time and we have to do that! For us and for the greater good! (I said it can take more than 1 day)</p><p>Finally the whole migration process took me 2 weeks, with pull requests and fixes included.</p><p>I would like to share my experience with you.</p><h3>Why?</h3><p>Let me explain <strong>why</strong> you also should check/update dependencies and have them up-to-date.</p><ol><li><a href="https://spring.io/blog/2019/08/06/it-is-time-goodbye-spring-boot-1-x"><strong><em>“It’s time to say goodbye”</em></strong></a><br>Official Spring blog post from 09–06–2019<em> </em>says it’s the end of 1.x version life.</li><li><strong>Compatibility</strong><br>We have several other services working on Spring Boot 2.x. For communication we are using Feign client which had compatibility issues between such different versions.</li><li><strong>Performance</strong><br>Jenkins builds used to take about <strong>1.5h and </strong>after update it’s <strong>0.5h.</strong></li><li><strong>New features</strong><br>Latest features and possibility of update to Java 11.</li><li><strong>Happy teammates</strong></li></ol><h3>Let’s start</h3><p>After one month I looked back on git history and all of commits that were made. Fortunately, during migration I kept idea of this article in mind.</p><p>Firstly, I would like to list how versions of some project dependencies have changed. In the next section, I will describe to you some steps.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd6e71407b779c9d5efd91c1a86b7e95/href">https://medium.com/media/fd6e71407b779c9d5efd91c1a86b7e95/href</a></iframe><h3>Steps</h3><p>Below I present selected cases on which I’ve spent some time. Enjoy, and I hope it will end up helpful.</p><ul><li><strong>Imports changes</strong><br>There are many many imports that have changed with dependencies. I will not list you all the dependencies from our project. You can easily find compatibility matrix for each. For example <a href="https://spring.io/projects/spring-cloud">Spring Cloud</a>. Your IDE will show you all import/dependency problems during compilation.</li><li><strong>Application properties</strong><br><a href="https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-properties-migrator">Properties migrator dependency</a> is really helpful during application properties migration (e.g <em>application.yml</em>). It will find and make all temporary replacements for you. Furthermore, it will print for you a warning about every change. <br>If you would like to do it on your own — feel free! <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html">Here</a> is the list of all properties used in Spring.</li><li><strong>Renaming JPA functions</strong><br>The following CrudRepository methods have been renamed:</li></ul><pre>save → saveAll<br>delete → deleteAll</pre><ul><li><strong>CrudRepository <em>findOne</em></strong> <br>Previous point only tells you about repository method name replacement. However, there is another change that requires more time. Repository function findOne<strong> </strong>has been replaced by findById<strong> </strong>and now it returns an Optional. It could be too messy to replace it in the whole project so I’ve created an extension below:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6865363a58797299615fa697a6a83ca/href">https://medium.com/media/c6865363a58797299615fa697a6a83ca/href</a></iframe><p>You can also use <strong>orElseThrow </strong>and throw an exception instead of returning null.</p><ul><li><strong>HttpServletRequestMapper is using <em>attributes</em> instead of <em>URI.</em></strong><br>We are using request mapper in the versioning process to lookup for versions of a given endpoint.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c9255f6c17149e074ed9b48c25dccc1/href">https://medium.com/media/8c9255f6c17149e074ed9b48c25dccc1/href</a></iframe><ul><li><strong>Health indicators on startup </strong><br>Honestly I didn’t notice it in Spring Boot 1.5.4 but according to <a href="https://docs.spring.io/spring-boot/docs/1.5.4.RELEASE/reference/html/production-ready-endpoints.html">documentation</a> it was already there. 😕 <br>If you are using spring. mail MailHealthIndicator will check connection on startup. You can disable it in properties by setting: management.health.mail.enabled=false</li><li><strong>Abstract class need open val/var</strong><br>Classes that extend or override regular params of an abstract class would not work. Abstract class params need to be open.</li><li><strong>LocalDate/Time in entities requires columnDefinition</strong><br>Having LocalDate/Time in your entity can be problematic for schema creator. I had to add columnDefinitions to every entity column of type as below:</li></ul><pre>java.time.LocalDate → @Column(columnDefinition=DATE)<br>java.time.LocalTime → @Column(columnDefinition=TIME)</pre><ul><li><strong>Default Charset </strong><br>I’ve had problems with JSON encoding in integration tests. The response had incorrectly encoded characters. Not sure what was the cause but I found a solution. I’ve added default charset to our JacksonConfig.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/096e3bab43cee04688cc4f32957b9fa1/href">https://medium.com/media/096e3bab43cee04688cc4f32957b9fa1/href</a></iframe><ul><li><strong>Page object JSON format change</strong><br>After migration Page object consumed as JSON structure has changed. I’ve figured it out when one of tests has failed. After some research, I’ve added this construction in our CustomPageImpl:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69ac34391547af5021dae11018cb7b17/href">https://medium.com/media/69ac34391547af5021dae11018cb7b17/href</a></iframe><p>Helpful links: <a href="https://stackoverflow.com/q/34647303/7990631">StackOverflow</a>, <a href="https://www.wimdeblauwe.com/blog/2018/2018-06-10-pageimpl-json-serialization-with-spring-boot-2/">blog post</a>.</p><ul><li><strong>Bean overriding</strong><br>In case of having multiple beans of the same name based on active profile, adding allow-bean-definition-overriding: true helped</li><li><strong>Gradle BootRepackage renamed</strong><br>According to <a href="https://spring.io/blog/2017/04/05/spring-boot-s-new-gradle-plugin">this article</a>, bootRepackage has been replaced with bootJarand bootWar.</li><li><strong>Flyway default Schema History Table renamed</strong><br>Flyway version have changed from 3.x → 6.x.<br>So you will need to rename default table name in application properties. Flyway 6.x is uses flyway_schema_history as default table. It’s described in detail on <a href="https://stackoverflow.com/a/49067389/7990631">StackOverflow</a>.</li></ul><pre>flyway:<br>   table: &quot;schema_version&quot; </pre><p>Another solution is to rename table directly in database.</p><ul><li><strong>Integration and unit test </strong><br>Having about 2k tests written with JUnit 4 and migrating them to JUnit 5 seems to be time-consuming.<a href="https://mvnrepository.com/artifact/org.junit.vintage/junit-vintage-engine"> JUnit Vintage dependency</a> turned out to be helpful. It provides engine for running JUnit 4 tests.<br>If you would like to migrate to Junit 5, <a href="https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-properties-migrator">JUnit docs</a> or <a href="https://www.codingrevolution.com/junit-5-migration/">this article</a> could be helpful.</li><li><strong>Dependencies cleanup</strong><br>Running ./gradlew dependencies shows dependency tree and possible updates. After executing this task I’ve found some dependencies that we imported separately before migration which are now included in another dependency or just duplicated.<br>For example: <br>After update we had two hamcrest dependencies.<br>And this is gradle task execution result:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d50fda23646fc189de4578cb6f2ec4df/href">https://medium.com/media/d50fda23646fc189de4578cb6f2ec4df/href</a></iframe><p>So I’ve simply removed the older one.</p><h3>Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/166/1*L9HEAKK-33i0OA6e3iX9Vw.png" /><figcaption>Icons made by <a href="https://www.flaticon.com/authors/freepik">Freepik</a> from <a href="https://www.flaticon.com/">https://www.flaticon.com/</a></figcaption></figure><p>So here we are. Project builds, Jenkins is green, I’m alive, teammates are happy, our project is as fresh as when it was initialized 3 years ago. I would like to share some final insights:</p><ul><li>Check out <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide">official Spring Boot migration article </a>and use <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide#configuration-properties-migration">properties migrator</a> that will speed up first steps.</li><li>Keep your git clean. Work on separate branch. Merge master to avoid conflicts. Describe changes in commits. I think that without it I wouldn’t be able to write this article today.</li><li>If you have other services depending on each other be careful about dependency compatibility e.g. Spring Cloud.</li><li>Keep dependencies up to date. ./gradlew dependencies will help you find updates.</li></ul><p>Hopefully you will spend less time than I did.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a87295630cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rsq-technologies/migration-guide-from-spring-boot-1-5-to-2-2-x-3a87295630cc">Migration Guide from Spring Boot 1.5 to 2.2.x</a> was originally published in <a href="https://medium.com/rsq-technologies">RSQ Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>