{"id":231915,"date":"2025-03-03T00:27:07","date_gmt":"2025-03-03T08:27:07","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=231915"},"modified":"2025-03-03T23:16:30","modified_gmt":"2025-03-04T07:16:30","slug":"queue-based-load-leveling-pattern-starring-phi4-and-azure-service-bus","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/queue-based-load-leveling-pattern-starring-phi4-and-azure-service-bus\/","title":{"rendered":"Queue-Based Load Leveling Pattern (Starring Phi4, LangChain4j and Azure Service Bus)"},"content":{"rendered":"<p class=\"code-line\" dir=\"auto\" data-line=\"2\">In this blog, we\u2019re exploring the Queue-Based Load Leveling pattern\u2014a powerful method for smoothing out workload spikes<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"4\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email.webp\"><img decoding=\"async\" class=\"alignnone wp-image-231916\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-1024x585.webp\" alt=\"\" width=\"499\" height=\"285\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-1024x585.webp 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-300x171.webp 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-768x439.webp 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-1536x878.webp 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email.webp 1792w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/a><\/p>\n<h2 id=\"why-choose-queue-based-load-leveling\" class=\"code-line\" dir=\"auto\" data-line=\"6\">Why Choose Queue-Based Load Leveling?<\/h2>\n<p class=\"code-line\" dir=\"auto\" data-line=\"8\">In today&#8217;s fast-paced software environment, dynamic workloads are common. The\u00a0<strong>Queue-Based Load Leveling pattern<\/strong>\u00a0decouples the production and consumption of tasks by introducing a queue between them. This allows producers and consumers to work independently, preventing system overload during traffic spikes.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"10\">For small, monolithic applications, in-memory queues might suffice. However, as applications scale or adopt distributed architectures, these simple queues can become bottlenecks. In a distributed setting, relying on in-memory queues means the entire message load is handled by a single node&#8217;s memory, which can quickly become a congestion point under heavy traffic. This setup lacks scalability, fault tolerance, and load balancing, making it difficult to efficiently manage surges in workload without increased latency or potential message loss.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"12\">This is where\u00a0<strong>Azure Service Bus<\/strong>\u00a0comes into play. As a robust, cloud-native messaging solution, it provides the scalability, durability, and resilience that modern applications demand.<\/p>\n<hr class=\"code-line\" dir=\"auto\" data-line=\"14\" \/>\n<h2 id=\"overview-of-the-sample-application\" class=\"code-line\" dir=\"auto\" data-line=\"16\">Overview of the Sample Application<\/h2>\n<p class=\"code-line\" dir=\"auto\" data-line=\"18\">We&#8217;ll demonstrate the pattern with a sample application that implements the Queue-Based Load Leveling pattern in Java. Here&#8217;s what it entails:<\/p>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"20\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"20\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"20\"><strong>Email Simulation:<\/strong>\nMultiple producers generate email tasks\u2014each with a unique ID\u2014and enqueue them into a shared\u00a0<code>BlockingQueue<\/code>. Consumers process these tasks asynchronously. A \u201cpoison pill\u201d mechanism ensures that consumer threads terminate gracefully when their work is done.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"23\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"23\"><strong>Real-Time Status Dashboard:<\/strong>\nA Swing-based UI updates every 500 milliseconds, displaying live metrics such as current queue length, total emails produced, processed counts, and the number of active threads.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"26\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"26\"><strong>LLM-Generated Performance Report:<\/strong>\nAt the end of the simulation, the application gathers performance metrics and crafts a prompt for LangChain4j. Using Ollama with the phi4 model, it then streams a natural language report summarizing overall performance.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"29\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"29\"><strong>Modern Concurrency with Java 21:<\/strong>\nLeveraging Java 21\u2019s virtual threads, the application handles concurrency efficiently, reducing traditional overhead and making the code both cleaner and faster.<\/p>\n<\/li>\n<\/ul>\n<hr class=\"code-line\" dir=\"auto\" data-line=\"32\" \/>\n<h2 id=\"getting-started\" class=\"code-line\" dir=\"auto\" data-line=\"34\">Getting Started<\/h2>\n<h3 id=\"prerequisites\" class=\"code-line\" dir=\"auto\" data-line=\"36\">Prerequisites<\/h3>\n<p class=\"code-line\" dir=\"auto\" data-line=\"38\">Before diving in, ensure you have:<\/p>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"40\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"40\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"40\"><strong>Java 21:<\/strong>\nLeverage the latest Java features, including virtual threads.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"43\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"43\"><strong>Maven:<\/strong>\nManage dependencies and build the project seamlessly.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"46\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"46\"><strong>Ollama:<\/strong>\nInstall\u00a0<a href=\"https:\/\/ollama.com\/\" data-href=\"https:\/\/ollama.com\/\">Ollama<\/a>\u00a0and set up the phi4 model:<\/p>\n<\/li>\n<\/ul>\n<pre class=\"prettyprint language-default\" style=\"padding-left: 40px;\"><code class=\"language-default\">ollama run phi4<\/code><\/pre>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"40\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"46\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"51\">Ensure the LLM server is accessible at\u00a0<code>http:\/\/localhost:11434<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"installation-steps\" class=\"code-line\" dir=\"auto\" data-line=\"53\">Installation Steps<\/h3>\n<ol class=\"code-line\" dir=\"auto\" data-line=\"55\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"55\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"55\"><strong>Clone the Repository:<\/strong><\/p>\n<pre><code class=\"code-line language-bash\" dir=\"auto\" data-line=\"56\">git <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/roryp\/queue-load-leveling\r\n<span class=\"hljs-built_in\">cd<\/span> queue-load-leveling<\/code><\/pre>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"61\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"61\"><strong>Build the Project:<\/strong><\/p>\n<pre><code class=\"code-line language-bash\" dir=\"auto\" data-line=\"62\">mvn clean package<\/code><\/pre>\n<p class=\"code-line\" dir=\"auto\" data-line=\"65\">This compiles your source code and produces an executable JAR in the\u00a0<code>target<\/code>\u00a0directory.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"running-the-application\" class=\"code-line\" dir=\"auto\" data-line=\"67\">Running the Application<\/h3>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"69\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"69\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"69\"><strong>Start the LLM Service:<\/strong>\nEnsure Ollama is running:<\/p>\n<\/li>\n<\/ul>\n<pre class=\"prettyprint language-default\" style=\"padding-left: 40px;\"><code class=\"language-default\">ollama run phi4<\/code><\/pre>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"69\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"75\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"75\"><strong>Launch the Application:<\/strong>\nStart the application with:<\/p>\n<\/li>\n<\/ul>\n<pre class=\"prettyprint language-default\" style=\"padding-left: 40px;\"><code class=\"language-default\">java -jar target\/QueueLoadLevelingWithVirtualThreads.jar<\/code><\/pre>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"69\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"75\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"80\">A simple UI will appear with live metrics, and after a brief simulation, an LLM-generated performance report will be displayed in your console.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"82\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-231917\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report-1024x382.png\" alt=\"Image report\" width=\"1024\" height=\"382\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report-1024x382.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report-300x112.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report-768x286.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report-1536x572.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/report.png 1913w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<\/li>\n<\/ul>\n<blockquote class=\"code-line\" dir=\"auto\" data-line=\"84\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"84\"><strong>NOTE:<\/strong>\u00a0For a more detailed look into the architecture, <a href=\"https:\/\/docs.langchain4j.dev\/intro\/\">LangChain4j<\/a> components, and workflow of the email processor app, check out the\u00a0<a href=\"https:\/\/github.com\/roryp\/queue-load-leveling\/blob\/main\/demo.md\" data-href=\"demo.md\">demo.md<\/a>\u00a0file.<\/p>\n<\/blockquote>\n<hr class=\"code-line\" dir=\"auto\" data-line=\"86\" \/>\n<h2 id=\"advancing-to-azure-service-bus\" class=\"code-line\" dir=\"auto\" data-line=\"88\">Advancing to Azure Service Bus<\/h2>\n<p class=\"code-line\" dir=\"auto\" data-line=\"90\">While in-memory queues are suitable for prototyping, enterprise-grade applications require a messaging backbone that can handle heavy loads.\u00a0<strong>Azure Service Bus<\/strong>\u00a0offers:<\/p>\n<ul class=\"code-line\" dir=\"auto\" data-line=\"92\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"92\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"92\"><strong>Decoupling:<\/strong>\nOffload message processing to keep your main application responsive.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"95\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"95\"><strong>Scalability:<\/strong>\nAutomatically adjust to workload changes without overprovisioning.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"98\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"98\"><strong>Resilience:<\/strong>\nFeatures like message persistence, automatic retries, and dead-letter queues ensure your system can handle failures gracefully.<\/p>\n<\/li>\n<\/ul>\n<p class=\"code-line\" dir=\"auto\" data-line=\"101\">Azure Service Bus allows you to focus on your core business logic instead of managing low-level messaging operations. Instead of processing emails synchronously and risking performance bottlenecks during high-traffic periods, this design offloads email handling to a dedicated service. Deployed via\u00a0<strong>Azure Container Apps<\/strong>, the service continuously monitors the queue and processes messages asynchronously, ensuring reliable and scalable email management under heavy load.<\/p>\n<h2 id=\"mwa-reference-application-autoscaling-email-processor\" class=\"code-line\" dir=\"auto\" data-line=\"103\">MWA reference application Autoscaling Email Processor<\/h2>\n<p class=\"code-line\" dir=\"auto\" data-line=\"105\">Next, let\u2019s explore how the Contoso Fiber MWA reference application uses Azure Service Bus and Azure Container Apps to autoscale the email processor based on the number of messages in the queue.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"107\">The\u00a0<code>email-processor<\/code>\u00a0container app is configured to autoscale based on the number of messages in the Azure Service Bus. The\u00a0<code>email-processor<\/code>\u00a0container app scales out when the number of messages in the Service Bus exceeds a certain threshold.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"109\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-231918\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule-1024x498.png\" alt=\"Image email processor scaling rule\" width=\"1024\" height=\"498\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule-1024x498.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule-300x146.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule-768x374.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule-1536x747.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/email-processor-scaling-rule-2048x996.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"111\">To simulate the autoscaling, follow the steps below:<\/p>\n<ol class=\"code-line\" dir=\"auto\" data-line=\"113\">\n<li class=\"code-line\" dir=\"auto\" data-line=\"113\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"113\">Navigate to Azure App Configuration and change the\u00a0<code>CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE<\/code>\u00a0value to\u00a0<code>demo-load<\/code>.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"115\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-231919\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting-1024x492.png\" alt=\"Image edit application setting\" width=\"1024\" height=\"492\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting-1024x492.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting-300x144.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting-768x369.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting-1536x739.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/edit-application-setting.png 1643w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"117\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"117\">Restart the Web App in App Service.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"119\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-231920\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service-1024x424.png\" alt=\"Image restart app service\" width=\"1024\" height=\"424\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service-1024x424.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service-300x124.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service-768x318.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service-1536x636.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/restart-app-service-2048x848.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"121\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"121\">Send an email following the steps\u00a0<a href=\"https:\/\/github.com\/Azure\/modern-web-app-pattern-java\/blob\/main\/demo.md\" data-href=\"https:\/\/github.com\/Azure\/modern-web-app-pattern-java\/blob\/main\/demo.md\">in the Strangler Fig Pattern section of the reference application &#8211; https:\/\/github.com\/Azure\/modern-web-app-pattern-java\/blob\/main\/docs\/SranglerFig.md<\/a>.<\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"123\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"123\">Navigate to the Azure Service Bus in the Azure portal. You will see a spike in incoming messages.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"125\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-231921\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages-1024x460.png\" alt=\"Image service bus incoming messages\" width=\"1024\" height=\"460\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages-1024x460.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages-300x135.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages-768x345.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages-1536x691.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/service-bus-incoming-messages-2048x921.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<\/li>\n<li class=\"code-line\" dir=\"auto\" data-line=\"127\">\n<p class=\"code-line\" dir=\"auto\" data-line=\"127\">Navigate to the Container App in the Azure portal and click on the\u00a0<code>Revisions and replicas<\/code>\u00a0link under\u00a0<code>Application<\/code>\u00a0in the left navigation. Finally, click on the\u00a0<code>Replicas<\/code>\u00a0tab. You will see that the number of replicas has increased.<\/p>\n<p class=\"code-line\" dir=\"auto\" data-line=\"129\"><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-231922\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas-1024x586.png\" alt=\"Image container app revisions replicas\" width=\"1024\" height=\"586\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas-1024x586.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas-300x172.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas-768x439.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas-1536x879.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/02\/container-app-revisions-replicas-2048x1171.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<\/li>\n<\/ol>\n<h2 id=\"conclusion\" class=\"code-line\" dir=\"auto\" data-line=\"131\">Conclusion<\/h2>\n<p class=\"code-line\" dir=\"auto\" data-line=\"133\">Integrating Azure Service Bus with queue-based load leveling empowers your Java applications with unparalleled scalability and resilience. Offloading critical operations to containerized services like Azure Container Apps keeps your system performing at its best, even under heavy loads. Embracing modern patterns like queue-based load leveling is key to building scalable, resilient applications. Integrating tools like Azure Service Bus into your Java projects can transform the way your systems handle load and scale &#8211; get started now with the\u00a0<a href=\"https:\/\/github.com\/Azure\/modern-web-app-pattern-java\" data-href=\"https:\/\/github.com\/Azure\/modern-web-app-pattern-java\">Modern Web App Pattern for Java<\/a><\/p>\n<hr class=\"code-line\" dir=\"auto\" data-line=\"136\" \/>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we\u2019re exploring the Queue-Based Load Leveling pattern\u2014a powerful method for smoothing out workload spikes Why Choose Queue-Based Load Leveling? In today&#8217;s fast-paced software environment, dynamic workloads are common. The\u00a0Queue-Based Load Leveling pattern\u00a0decouples the production and consumption of tasks by introducing a queue between them. This allows producers and consumers to work independently, [&hellip;]<\/p>\n","protected":false},"author":29534,"featured_media":231916,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[816,14,1,8,15],"tags":[],"class_list":["post-231915","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-container-apps","category-cloud","category-java","category-open-source","category-vscode"],"acf":[],"blog_post_summary":"<p>In this blog, we\u2019re exploring the Queue-Based Load Leveling pattern\u2014a powerful method for smoothing out workload spikes Why Choose Queue-Based Load Leveling? In today&#8217;s fast-paced software environment, dynamic workloads are common. The\u00a0Queue-Based Load Leveling pattern\u00a0decouples the production and consumption of tasks by introducing a queue between them. This allows producers and consumers to work independently, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/231915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/29534"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=231915"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/231915\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/231916"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=231915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=231915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=231915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}