SNS (Simple Notification Service) is often used to implement a pubsub workflow, or to fan-out a process. In such cases, you may want to trigger an AWS Lambda function when an event arrives to a topic. In this post, we’ll deploy an AWS Lambda and trigger it through an SNS subscription using Floci . Series How to use AWS CLI with Floci for local development How to run SQS-triggered Lambda locally…
One of the common ways to run asynchronous workloads is through an AWS Lambda function triggered by a message from SQS (Simple Queue Service). SQS helps control the order of processing, and serves as a buffer to handle temporary spikes in load on a system. Let’s explore how we can do this locally using Floci . Series How to use AWS CLI with Floci for local development How to run SQS-triggered…
Testing against real AWS services often feels like a chore. We have to juggle account configurations, suffer the network latency tax, and dodge state collisions with team members. And let’s not forget about the constant paranoia of surprise cloud bills. It often kills the fast feedback loop we need to build good software. So, how do we get around this? We bring AWS to localhost using Floci . It is…
This is my personal setup for macOS Sequoia 15 . If something feels opinionated, it probably is. First steps Open System Settings and apply the following changes. TrackPad [Point & Click] > set Tap to click: ON Trackpad [Scroll & Zoom] > set Natural scrolling: OFF Displays > select resolution smaller than Default . This trades pixel density for larger text. Accessibility > Pointer…
While building a generalized API, you may come across scenarios where the structure of the incoming request can change based on certain characteristics. In Java, such scenarios are handled with polymorphism which involves introducing an interface to represent multiple types. In this post, we’ll explore how to handle polymorphic requests using Jackson , a popular data-processing library for Java.…
RabbitMQ is an open source message broker. It supports a variety of messaging and streaming protocols, and can be used to implement message queues, which is the focus of this post. A typical message flow in RabbitMQ works as follows: a producer sends a message to an exchange, which routes the message to one or more queues based on rules defined by the exchange type. To receive messages, a queue…
OpenAPI Initiative is a widely adopted industry standard to describe and document API, with Swagger being one of its most well-known implementations. springdoc-openapi is an actively maintained integration for Spring Boot applications to quickly generate and publish OpenAPI documentation. In this post, we’ll explore how we can use Springdoc with a Spring Boot project. Note The examples in this…
JSON Web Token (JWT) is an open standard to send information (known as claims ) as a JSON object. When digitally signed using a secret key or a public/private key pair, the recipient can verify and trust the claims. JWTs are compact and self-contained, making them well-suited for authentication and authorization. It’s no surprise that industry standards like OAuth 2.0 and OpenID Connect (OIDC) use…
Ory Hydra is an open source OAuth 2.0 and OpenID Connect server. It can issue and introspect tokens used by machine clients for server-to-server communication, making it perfect for locally testing how services access APIs. In this post, we’ll setup Ory Hydra using Docker, register a client, and test the client_credentials flow using curl . Note The examples in this post use: Ory Hydra 25.4.0…
Everyday we work with resources in our programs — editing files, fetching records from databases, and more. We open a resource, do the necessary work, and then close it. When we miss that final step, we end up with files inaccessible to other processes, locked database connections, or an unexpectedly large cloud bill. To ensure we deterministically clean up the resources, even when an error…
Method logging is a useful technique for collecting runtime data, such as execution time, input parameters, and return values, about a method. While we can do this manually, it becomes tedious at scale. It makes sense to be lazy here and automate it. In this post, we’ll build a consistent and reusable method logging approach using aspects and Spring AOP. Note The code in this post is written…
AspectJ is an aspect-oriented programming (AOP) extension for Java. It weaves aspects into Java bytecode at either compile-time or load-time. In a previous post , we explored load-time weaving using Spring AOP. In this post, we’ll revisit the same example, and reimplement it using the AspectJ Compiler ajc to weave aspects at compile time. Note The code in this post is written using: Java 25…
This is a collection of Git patterns, workflows, and configurations I’ve come to rely on over the years. I hope you find them as useful as I have! Tip Drop the --global flag to apply the configuration only to a specific Git project. Branches Set the default branch name git config --global init.defaultbranch $branch_name When you run git init , Git uses this configuration to create a default…
Back in 2023, I lamented on how clumsy it was to downgrade a Homebrew package. Fast forward to 2025, and the situation has not improved at all. Judge for yourself as I walk you through the hoops. Say you want to downgrade to Node.js 22. You dutifully download the formula for this version from GitHub. curl --silent…
Spring Boot Actuator offers a useful capability to show the details about an application. For example, the health endpoint provides basic application health information. Similarly, you can show any custom information through the info endpoint. For example, you can put the following configuration to provide the application version and the Java version used by it. management:…
Micronaut is an open source Java framework designed to build microservices and serverless applications. Unlike other frameworks that use reflection-based dependency injection, Micronaut performs most of this work at compile time, improving performance and efficiency. This makes it handy for writing cloud-native applications, such as an AWS Lambda function. In this post, we’ll do exactly this. Note…
In my time with Nushell, I’ve collected a set of commands and configurations that have helped streamline my workflows. Maybe you’ll find something helpful in here as well. Tip If you haven’t tried Nushell yet, give it a shot! It’s a fantastic alternative to classic shells like Bash and Zsh. Directory operations Relative directory navigation Just type . or .. to navigate relative directories, no…
When your application uses external components such as databases or cloud services, it’s important to test how everything works together. That’s where integration tests come in. They help ensure your application behaves as expected in an environment that resembles production. Testcontainers is a popular library that spins up real dependencies using Docker to run your tests. Let’s write a small…
When writing tests, it is quite common to mock a module. One way to do this is by injecting a custom module in sys.modules : import sys from testcontainers.localstack import LocalStackContainer def mock_module(localstack_container: LocalStackContainer): mocked_module = type(sys)('clients') mocked_module.s3 = localstack_container.get_client('s3') sys.modules['clients'] = mocked_module Note In this…
Amazon EventBridge is a serverless service for building event-driven loosely coupled workflows. It can trigger AWS Lambda functions based on specific rules. This is really handy for tasks like optimizing images after S3 uploads, generating aggregated reports from DynamoDB updates, or reacting to changes in other AWS resources. In this post, we’ll deploy a Lambda function, and trigger it through an…