<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Spring Boot on Abdelbaki Ben Elhaj Slimene</title><link>https://bakic.github.io/categories/spring-boot/</link><description>Recent content in Spring Boot on Abdelbaki Ben Elhaj Slimene</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 12 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://bakic.github.io/categories/spring-boot/index.xml" rel="self" type="application/rss+xml"/><item><title>Creating OpenAPI 3.0 Documentation for a Spring REST API</title><link>https://bakic.github.io/posts/openapi-documentation-spring-rest-api/</link><pubDate>Sun, 12 May 2024 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/openapi-documentation-spring-rest-api/</guid><description>&lt;p&gt;Documenting REST APIs is important so that consumers of these APIs can know exactly how to integrate them into their systems. This documentation can be written manually, which will be time-consuming and error-prone, or generated automatically using libraries. Here comes to play the &lt;a href="http://springdoc.org/"&gt;springdoc-openapi&lt;/a&gt; library.&lt;/p&gt;&#10;&lt;p&gt;In this blog post, we will see how to use this library and integrate it into our spring boot project to have up-to-date documentation of our REST APIs.&lt;/p&gt;</description></item><item><title>Custom Bean Instantiation Using @ConditionalOnProperty Annotation in Spring Boot</title><link>https://bakic.github.io/posts/conditionalonproperty-custom-beans-spring-boot/</link><pubDate>Mon, 26 Feb 2024 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/conditionalonproperty-custom-beans-spring-boot/</guid><description>&lt;p&gt;Spring boot is a widely used framework to bootstrap standalone web applications. Its flexibility and capabilities in beans management make the life of the developer much easier compared to the manual handling of these components.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="image-1.jpg" alt=""&gt;&lt;/p&gt;&#10;&lt;p&gt;In this blog post, I will describe a use case where I needed the help of Spring Boot to create beans based on a configuration set in my &lt;code&gt;application.yml&lt;/code&gt; file.&lt;/p&gt;&#10;&lt;h2 id="problem-description"&gt;Problem Description&lt;/h2&gt;&#10;&lt;p&gt;I was working on a notification service where depending on events received and the configuration set up, notifications of different types were sent to users. These notifications were emails, SMS messages and push notifications for mobile applications.&lt;/p&gt;</description></item><item><title>Spring Boot Profiles Best Practices</title><link>https://bakic.github.io/posts/spring-boot-profiles-best-practices/</link><pubDate>Sat, 05 Aug 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/spring-boot-profiles-best-practices/</guid><description>&lt;p&gt;Spring Boot profiles provide a powerful way to manage application configurations for different environments or scenarios. By using profiles, developers can easily customize the behavior of their applications based on the target environment, such as development, testing, production, or specific customer requirements.&lt;/p&gt;&#10;&lt;p&gt;This article explores the best practices for utilizing Spring Boot profiles, including defining and activating profiles, organizing configuration files, managing profile-specific dependencies, testing and debugging, and addressing common pitfalls. Understanding and implementing these best practices will help developers harness the full potential of Spring Boot profiles and enhance the flexibility, maintainability, and scalability of their applications.&lt;/p&gt;</description></item><item><title>Comparison between the different ways of dependency injection in Spring</title><link>https://bakic.github.io/posts/dependency-injection-ways-in-spring/</link><pubDate>Fri, 05 Mar 2021 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/dependency-injection-ways-in-spring/</guid><description>&lt;p&gt;&lt;img src="image-1.jpg" alt="Photo by Fazly Shah on Unsplash"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@fazlyshah?utm_source=medium&amp;amp;utm_medium=referral"&gt;Fazly Shah&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Dependency injection is a core feature of the Spring framework. It is used by Spring to set the bean’s dependencies while initializing the application context. We usually use &lt;code&gt;@Autowired&lt;/code&gt; annotation to get a reference to a bean in the Spring context.&lt;/p&gt;&#10;&lt;p&gt;Dependency injection in Spring can be done in three different ways: fields, setter, and constructor. In this article, we will explain each one and give their pros and cons.&lt;/p&gt;</description></item></channel></rss>