<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Abdelbaki Ben Elhaj Slimene</title><link>https://bakic.github.io/posts/</link><description>Recent content in Posts on Abdelbaki Ben Elhaj Slimene</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 02 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://bakic.github.io/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Making 'Nothing Leaves Your Browser' a Promise the Browser Enforces</title><link>https://bakic.github.io/posts/csp-privacy-client-side-developer-tools/</link><pubDate>Mon, 02 Nov 2026 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/csp-privacy-client-side-developer-tools/</guid><description>&lt;p&gt;Developers paste things into online tools that they would never put in a public chat: a JWT from staging, a JSON payload with customer data, a connection string with the password still in it. Every &amp;ldquo;format your JSON online&amp;rdquo; site says it doesn&amp;rsquo;t store what you paste. Almost none of them can prove it, and you can&amp;rsquo;t tell the difference between a site that doesn&amp;rsquo;t upload your input and a site that just says so.&lt;/p&gt;</description></item><item><title>Migrating from SMTP to AWS SES with IAM Roles: A Security-First Approach to Email in Spring Boot</title><link>https://bakic.github.io/posts/smtp-to-aws-ses-iam-roles-spring-boot/</link><pubDate>Wed, 28 Jan 2026 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/smtp-to-aws-ses-iam-roles-spring-boot/</guid><description>&lt;p&gt;Sending emails is a fundamental requirement for most applications. Whether it’s transactional notifications, alerts, or user communications, we need a reliable and secure way to dispatch messages.&lt;/p&gt;&#10;&lt;p&gt;In this article, I’ll walk through our migration from traditional SMTP authentication to AWS SES with IAM role-based authentication, explaining why this shift represents a significant security improvement.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="image-1.jpg" alt="Photo by CHUTTERSNAP on Unsplash"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@chuttersnap?utm_source=medium&amp;amp;utm_medium=referral"&gt;CHUTTERSNAP&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;h2 id="the-traditional-approach-smtp-with-credentials"&gt;The Traditional Approach: SMTP with Credentials&lt;/h2&gt;&#10;&lt;p&gt;For years, the standard way to send emails from a Spring Boot application has been through SMTP with username and password authentication:&lt;/p&gt;</description></item><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>Optimizing Java Application Performance with Asynchronous Logging in Logback</title><link>https://bakic.github.io/posts/asynchronous-logging-logback/</link><pubDate>Sun, 19 Nov 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/asynchronous-logging-logback/</guid><description>&lt;p&gt;Logging is an essential component of successful debugging, accurate monitoring, and comprehensive auditing in the evolving world of Java application development. However, as applications get more complex and manage higher loads, the influence of traditional logging systems on overall performance cannot be ignored. Asynchronous logging appears as a game changer in this context, providing a seamless combination of rich logging features without sacrificing application speed. This game-changing technology has changed the way developers handle logging in scalable, high-performance systems. In this article we will explore the world of asynchronous logging, learn about its importance and use in current Java development.&lt;/p&gt;</description></item><item><title>A Closer Look at Annotations in Java</title><link>https://bakic.github.io/posts/a-closer-look-at-annotations-in-java/</link><pubDate>Mon, 06 Nov 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/a-closer-look-at-annotations-in-java/</guid><description>&lt;p&gt;Annotations are a form of meta-data that provides additional information about code elements, such as classes, methods, fields, and more. They were introduced in Java 5 and have become an integral part of the language. Annotations are identified by the &lt;code&gt;@&lt;/code&gt; symbol and can be used for various purposes. In this article, we are going to take a deep dive on annotations where we are going to see how they are build and how to use them through an example.&lt;/p&gt;</description></item><item><title>Presigned URLs in AWS S3: Secure File Upload and Download</title><link>https://bakic.github.io/posts/presigned-urls-aws-s3/</link><pubDate>Mon, 09 Oct 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/presigned-urls-aws-s3/</guid><description>&lt;p&gt;Amazon Simple Storage Service (S3) is an object storage service offered by Amazon Web Services (AWS). It allows users to store and retrieve data from anywhere on the web. While you can manage S3 objects directly through the AWS Management Console and the AWS SDKs with dedicated permissions, there are situations where you need to securely grant temporary access to your S3 objects without exposing your AWS credentials. This is where presigned URLs come into play.&lt;/p&gt;</description></item><item><title>Switch Statement in Java: From Basic to Pattern Matching</title><link>https://bakic.github.io/posts/switch-statement-in-java-pattern-matching/</link><pubDate>Tue, 29 Aug 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/switch-statement-in-java-pattern-matching/</guid><description>&lt;p&gt;The switch statement is a fundamental control structure in Java, allowing developers to execute different code blocks based on the value of an expression. Before the introduction of advanced features like pattern matching and switch expressions, Java&amp;rsquo;s switch statement underwent several stages of evolution. In this blog post, we&amp;rsquo;ll take a journey through the evolution of the switch statement, exploring its various stages and providing detailed examples and explanations along the way.&lt;/p&gt;</description></item><item><title>The Most Used Stream Operations in Java With Examples</title><link>https://bakic.github.io/posts/the-most-used-stream-operations-in-java-with-examples/</link><pubDate>Sat, 12 Aug 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/the-most-used-stream-operations-in-java-with-examples/</guid><description>&lt;p&gt;Stream operations were introduced in Java 8 and they allow you to manipulate collections of data in a concise and functional way. A stream can be seen as a sequence of elements that you can perform various operations on, such as filtering, mapping, or reducing.&lt;/p&gt;&#10;&lt;p&gt;This article serves as a comprehensive guide to the most commonly used stream operations, with clear explanations and practical examples.&lt;/p&gt;&#10;&lt;h2 id="setting-up-and-creating-streams"&gt;Setting up and Creating Streams&lt;/h2&gt;&#10;&lt;p&gt;To work with stream operations, you need to create a stream first. Streams can be created from various data sources, including collections, arrays, or input/output channels. For example, to create a stream from a list, you can use the &lt;code&gt;stream()&lt;/code&gt; method:&lt;/p&gt;</description></item><item><title>A Deep Dive into the flatMap Operation of the Stream API in Java with Examples</title><link>https://bakic.github.io/posts/flatmap-stream-api-java/</link><pubDate>Thu, 10 Aug 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/flatmap-stream-api-java/</guid><description>&lt;p&gt;The &lt;code&gt;flatMap&lt;/code&gt; operation is an intermediate operation provided by the Stream API, which allows you to transform each element of a stream into zero or more elements and then flatten the resulting elements into a single stream. It&amp;rsquo;s useful to use with nested data structures, such as lists within lists and effectively &amp;ldquo;flattening&amp;rdquo; them into a more manageable format.&lt;/p&gt;&#10;&lt;p&gt;In this article we are going to explain how this operation works internally and give some examples.&lt;/p&gt;</description></item><item><title>Sealed Classes in Java</title><link>https://bakic.github.io/posts/sealed-classes-in-java/</link><pubDate>Mon, 07 Aug 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/sealed-classes-in-java/</guid><description>&lt;p&gt;Sealed classes, a new addition to the Java programming language starting from Java 15, provide developers with a powerful tool for defining restricted class hierarchies. By explicitly specifying which classes can extend or implement them, sealed classes offer enhanced control over inheritance and extensibility.&lt;/p&gt;&#10;&lt;p&gt;This article explores the concept of sealed classes in Java, their syntax and declaration, as well as their purpose, benefits, and limitations.&lt;/p&gt;&#10;&lt;h2 id="what-are-sealed-classes"&gt;What are Sealed Classes?&lt;/h2&gt;&#10;&lt;p&gt;Sealed classes in Java are a new feature introduced in Java 15 that allows developers to restrict the inheritance hierarchy of a class. By marking a class as sealed, you can control which other classes can extend it. This adds an extra layer of control and encapsulation to your code.&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>How to Send SMS messages using AWS SNS and Java: A Step-by-Step Guide</title><link>https://bakic.github.io/posts/send-sms-with-aws-sns/</link><pubDate>Wed, 02 Aug 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/send-sms-with-aws-sns/</guid><description>&lt;p&gt;When it comes to mobile applications, SMS messaging is still one of the most reliable and widely used communication channels. Amazon Web Services (AWS) provides a service called Simple Notification Service (SNS) that allows you to send SMS messages to mobile devices. In this article, we will walk you through the step-by-step process of setting up AWS SNS SMS in your Java project. We will cover creating an AWS account, configuring SNS to send SMS messages, creating an IAM user, and sending SMS messages from your Java application. By the end of this guide, you will have a solid understanding of how to implement AWS SNS SMS in your Java project.&lt;/p&gt;</description></item><item><title>A Comprehensive Comparison of AWS S3 Storage Classes</title><link>https://bakic.github.io/posts/aws-s3-storage-classes-comparison/</link><pubDate>Mon, 08 May 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/aws-s3-storage-classes-comparison/</guid><description>&lt;p&gt;AWS S3 storage has been one of the most popular and widely used cloud storage services in recent years. With its flexibility, scalability, and cost-effectiveness, S3 provides businesses with a reliable and secure way to store, retrieve, and manage their data. However, not all data is the same, and not all storage requirements are identical. To meet the diverse needs of customers, AWS offers a range of S3 storage classes, each optimized for a particular use case. In this article, we will explore the different S3 storage classes, their features, and best practices for their use, to help you choose the right storage class for your organization’s needs.&lt;/p&gt;</description></item><item><title>Object Versioning in S3</title><link>https://bakic.github.io/posts/object-versioning-in-s3/</link><pubDate>Thu, 06 Apr 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/object-versioning-in-s3/</guid><description>&lt;p&gt;Object versioning is a powerful feature that allows you to store multiple versions of an object within a bucket. By default, versioning is disabled on a bucket, but you can easily enable it if desired. Once enabled, you cannot disable it, but you can suspend it if needed. A suspended bucket can be re-enabled at any time.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="image-1.png" alt=""&gt;&lt;/p&gt;&#10;&lt;p&gt;Without versioning enabled, each object in a bucket is identified solely by its unique name, or object key. If you modify an object, the original version is replaced. However, with versioning enabled, any modifications to an object generate a new version while leaving the original intact. For example, let’s say you have a bucket with a picture called “logo.jpg”. If you modify or delete this object, those changes will impact the original object.&lt;/p&gt;</description></item><item><title>Buckets and Objects in S3</title><link>https://bakic.github.io/posts/buckets-and-objects-in-s3/</link><pubDate>Sat, 01 Apr 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/buckets-and-objects-in-s3/</guid><description>&lt;p&gt;S3 is a global storage platform that is accessible from anywhere with an Internet connection. It is a public service that runs from all AWS regions, making it a globally available resource&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="image-1.jpg" alt=""&gt;&lt;/p&gt;&#10;&lt;p&gt;However, S3 is regionally based, meaning that your data is stored in a specific AWS region and never leaves that region unless you explicitly configure it to do so.&lt;/p&gt;&#10;&lt;p&gt;This regional resilience ensures that your data is replicated across availability zones in that region, making it tolerant to the failure of an AZ. Additionally, S3 has the ability to replicate data between regions, providing an extra layer of protection for your data.&lt;/p&gt;</description></item><item><title>High availability VS Fault Tolerance VS Disaster Recovery</title><link>https://bakic.github.io/posts/high-availability-vs-fault-tolerance-vs-disaster-recovery/</link><pubDate>Mon, 20 Mar 2023 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/high-availability-vs-fault-tolerance-vs-disaster-recovery/</guid><description>&lt;p&gt;High availability, Fault Tolerance and Disaster Recovery are three concepts to understand for every Solution Architect. These concepts are sometimes mixed and the difference between each one is not clear enough.&lt;/p&gt;&#10;&lt;h4 id="high-availability-ha"&gt;High Availability (HA)&lt;/h4&gt;&#10;&lt;p&gt;First, let&amp;rsquo;s try to give the definition of high availability. Wikipedia has a pretty good one:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;High availability&lt;/strong&gt; (&lt;strong&gt;HA&lt;/strong&gt;) is a characteristic of a system which aims to ensure an agreed level of operational performance, usually &lt;a href="https://en.wikipedia.org/wiki/Uptime"&gt;uptime&lt;/a&gt;, for a higher than normal period.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>Records in Java</title><link>https://bakic.github.io/posts/records-in-java/</link><pubDate>Sat, 02 Oct 2021 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/records-in-java/</guid><description>&lt;p&gt;&lt;img src="image-1.jpg" alt="Photo by AltumCode on Unsplash"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@altumcode?utm_source=medium&amp;amp;utm_medium=referral"&gt;AltumCode&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;After being a preview feature in Java 14 and Java 15, Java records are now part of the Java language starting from Java 16.&lt;/p&gt;&#10;&lt;p&gt;In this article, we are going to take a deep dive into Java records and look at what this feature provides and how can we use it.&lt;/p&gt;&#10;&lt;h2 id="records"&gt;Records&lt;/h2&gt;&#10;&lt;p&gt;As per the &lt;a href="https://openjdk.java.net/jeps/395"&gt;JEP 395&lt;/a&gt;, records are described as &lt;code&gt;classes that act as transparent carriers for immutable data&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Forward Proxy vs Reverse Proxy</title><link>https://bakic.github.io/posts/forward-proxy-vs-reverse-proxy/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/forward-proxy-vs-reverse-proxy/</guid><description>&lt;p&gt;&lt;img src="image-1.jpg" alt="Photo by Pankaj Patel on Unsplash"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@pankajpatel?utm_source=medium&amp;amp;utm_medium=referral"&gt;Pankaj Patel&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;A proxy is a device that traffic gets routed through it: it is an intermediate between a client and a web server.&lt;/p&gt;&#10;&lt;p&gt;There are many types of proxies, each one serves different services. In this article, we are going to explain the difference between a forward proxy and a reverse proxy.&lt;/p&gt;&#10;&lt;h2 id="forward-proxy"&gt;Forward proxy&lt;/h2&gt;&#10;&lt;p&gt;&lt;img src="image-2.png" alt="Proxy"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Proxy&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;When people say proxy they typically mean a forward proxy.&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><item><title>Difference between Map and FlatMap in Java</title><link>https://bakic.github.io/posts/difference-between-map-and-flatmap-in-java/</link><pubDate>Thu, 18 Feb 2021 00:00:00 +0000</pubDate><guid>https://bakic.github.io/posts/difference-between-map-and-flatmap-in-java/</guid><description>&lt;p&gt;&lt;img src="image-1.jpg" alt="Photo by Clément Hélardot on Unsplash"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@clemhlrdt?utm_source=medium&amp;amp;utm_medium=referral"&gt;Clément Hélardot&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;The Stream API of Java 8 provides two intermediate stream operations used to perform actions on stream elements and return a stream as an output: &lt;code&gt;map&lt;/code&gt; and &lt;code&gt;flatMap&lt;/code&gt;. In this article, we are going to take a look at these two methods and explain the difference between them with examples.&lt;/p&gt;&#10;&lt;h2 id="map-function"&gt;Map function&lt;/h2&gt;&#10;&lt;p&gt;The &lt;code&gt;map&lt;/code&gt; function takes a &lt;code&gt;Function&lt;/code&gt; as a parameter and applies it to all the elements of the stream. The result will be a stream of the result of the function applied to each element of the initial stream. There is a &lt;strong&gt;one-to-one&lt;/strong&gt; mapping between the input and the output elements.&lt;/p&gt;</description></item></channel></rss>