<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gabriel Baldez</title>
    <description>The latest articles on DEV Community by Gabriel Baldez (@gabrielbbaldez).</description>
    <link>https://dev.to/gabrielbbaldez</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3818562%2Fe2a1eb2b-80af-4043-b502-5da7e80144d1.png</url>
      <title>DEV Community: Gabriel Baldez</title>
      <link>https://dev.to/gabrielbbaldez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabrielbbaldez"/>
    <language>en</language>
    <item>
      <title>I Built a Unified Notification Library for Java (Email, Slack, Telegram, SMS, and more)</title>
      <dc:creator>Gabriel Baldez</dc:creator>
      <pubDate>Wed, 11 Mar 2026 13:44:55 +0000</pubDate>
      <link>https://dev.to/gabrielbbaldez/notifyhub-unified-notifications-for-java-and-spring-boot-4jj2</link>
      <guid>https://dev.to/gabrielbbaldez/notifyhub-unified-notifications-for-java-and-spring-boot-4jj2</guid>
      <description>&lt;p&gt;Every backend system eventually needs notifications.&lt;/p&gt;

&lt;p&gt;You send emails for confirmations, Slack alerts for deployments, SMS for verification codes, Discord messages for internal tools, and webhooks for integrations.&lt;/p&gt;

&lt;p&gt;The problem is that each channel has its own SDK, configuration style, authentication, and API.&lt;/p&gt;

&lt;p&gt;Before long, your codebase ends up looking like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaMail for email&lt;/li&gt;
&lt;li&gt;Twilio SDK for SMS&lt;/li&gt;
&lt;li&gt;Slack webhook calls&lt;/li&gt;
&lt;li&gt;Telegram Bot API&lt;/li&gt;
&lt;li&gt;Custom HTTP clients for other services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every integration is different.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;NotifyHub&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Idea
&lt;/h2&gt;

&lt;p&gt;NotifyHub is an open-source notification library for &lt;strong&gt;Java and Spring Boot&lt;/strong&gt; that provides &lt;strong&gt;one unified API&lt;/strong&gt; to send notifications across multiple channels.&lt;/p&gt;

&lt;p&gt;Instead of integrating every provider separately, you use a single fluent interface.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"user@email.com"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;via&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Channel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EMAIL&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Channel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SLACK&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Order Confirmed"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Your order has shipped!"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;send&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One API. Multiple channels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported Channels
&lt;/h2&gt;

&lt;p&gt;NotifyHub currently supports &lt;strong&gt;20+ channels&lt;/strong&gt;, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email (SMTP)&lt;/li&gt;
&lt;li&gt;Slack&lt;/li&gt;
&lt;li&gt;Telegram&lt;/li&gt;
&lt;li&gt;Discord&lt;/li&gt;
&lt;li&gt;SMS&lt;/li&gt;
&lt;li&gt;WhatsApp&lt;/li&gt;
&lt;li&gt;Microsoft Teams&lt;/li&gt;
&lt;li&gt;Google Chat&lt;/li&gt;
&lt;li&gt;Firebase Push&lt;/li&gt;
&lt;li&gt;Webhooks&lt;/li&gt;
&lt;li&gt;Twitter / X&lt;/li&gt;
&lt;li&gt;LinkedIn&lt;/li&gt;
&lt;li&gt;Notion&lt;/li&gt;
&lt;li&gt;Twitch&lt;/li&gt;
&lt;li&gt;YouTube&lt;/li&gt;
&lt;li&gt;Instagram&lt;/li&gt;
&lt;li&gt;Facebook&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And you can easily add custom channels by implementing a single interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;NotifyHub is more than just a message sender.&lt;/p&gt;

&lt;p&gt;It includes infrastructure features commonly needed in real systems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fluent API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Readable builder pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;via&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Channel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EMAIL&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Security Alert"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Login from a new device detected"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;send&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fallback Chains&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If one channel fails, automatically try another.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;WhatsApp → SMS → Email&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retry + Dead Letter Queue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Failed messages retry automatically with configurable backoff.&lt;br&gt;
If all retries fail, the message goes to a DLQ for inspection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Templates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Email and message templates with Mustache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheduling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Send notifications later using delays or timestamps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Batch Sending&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Send to thousands of recipients with isolation for failures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Async Support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All sends can run asynchronously using &lt;code&gt;CompletableFuture&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delivery Tracking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each notification returns a delivery receipt with status and metadata.&lt;/p&gt;
&lt;h2&gt;
  
  
  Spring Boot Integration
&lt;/h2&gt;

&lt;p&gt;NotifyHub integrates directly with Spring Boot.&lt;/p&gt;

&lt;p&gt;Add the dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;io.github.gabrielbbaldez&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;notify-spring-boot-starter&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;1.0.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure your channels:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;notify&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;channels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;smtp.gmail.com&lt;/span&gt;
      &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;587&lt;/span&gt;
      &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${GMAIL_USER}&lt;/span&gt;
      &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${GMAIL_PASS}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inject and use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Autowired&lt;/span&gt;
&lt;span class="nc"&gt;NotifyHub&lt;/span&gt; &lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it.&lt;/p&gt;

&lt;h2&gt;
  
  
  REST API Mode
&lt;/h2&gt;

&lt;p&gt;If you don't use Java, you can run NotifyHub as a &lt;strong&gt;Docker container&lt;/strong&gt; and send notifications through HTTP.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 8080:8080 notifyhub-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then call it from any language:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /send/email
POST /send/discord
POST /send/slack
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  AI Integration
&lt;/h2&gt;

&lt;p&gt;NotifyHub also includes an &lt;strong&gt;MCP server&lt;/strong&gt; that exposes tools for AI assistants.&lt;/p&gt;

&lt;p&gt;This means tools like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude&lt;/li&gt;
&lt;li&gt;Cursor&lt;/li&gt;
&lt;li&gt;AI coding assistants&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;can send notifications directly.&lt;/p&gt;

&lt;p&gt;Example prompt:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Send an email to &lt;a href="mailto:john@example.com"&gt;john@example.com&lt;/a&gt; saying the deploy finished.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The AI calls the NotifyHub tool and sends it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Built This
&lt;/h2&gt;

&lt;p&gt;In many backend systems, notifications are scattered across services with different libraries and inconsistent patterns.&lt;/p&gt;

&lt;p&gt;The goal of NotifyHub is to provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;clean abstraction&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;consistent API&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;modular architecture&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;and a &lt;strong&gt;simple developer experience&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Links
&lt;/h2&gt;

&lt;p&gt;Project page&lt;br&gt;
&lt;a href="https://gabrielbbaldez.github.io/notify-hub/" rel="noopener noreferrer"&gt;https://gabrielbbaldez.github.io/notify-hub/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub&lt;br&gt;
&lt;a href="https://github.com/gabrielbbaldez/notify-hub" rel="noopener noreferrer"&gt;https://github.com/gabrielbbaldez/notify-hub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback Welcome
&lt;/h2&gt;

&lt;p&gt;This project is still evolving, and I'd love feedback from other developers.&lt;/p&gt;

&lt;p&gt;Especially about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;missing channels&lt;/li&gt;
&lt;li&gt;API design&lt;/li&gt;
&lt;li&gt;real-world use cases&lt;/li&gt;
&lt;li&gt;architecture improvements&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>showdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
