{"id":25245,"date":"2026-06-03T18:48:36","date_gmt":"2026-06-03T11:48:36","guid":{"rendered":"https:\/\/huongdanjava.com\/?p=25245"},"modified":"2026-06-03T18:49:22","modified_gmt":"2026-06-03T11:49:22","slug":"partitioning-with-rabbitmq-using-spring-cloud-stream","status":"publish","type":"post","link":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html","title":{"rendered":"Partitioning with RabbitMQ using Spring Cloud Stream"},"content":{"rendered":"<p>Partitioning in message queues is a mechanism that divides topics or queues into multiple partitions. Each partition stores a portion of the data, and this data is processed in parallel. This makes receiving and processing messages faster and more efficient!<\/p>\n<p>Apache Kafka supports partitioning natively, while RabbitMQ does not. However, you can easily implement partitioning with RabbitMQ using Spring Cloud Stream. Spring Cloud Stream provides solutions for implementing partitioning with any message broker. You can implement partitioning in your application code and easily switch between different message brokers without changing much code. Spring Cloud Stream ensures that related messages, for example, with the same user ID, are handled by the same consumer instance (in cases where multiple consumer instances subscribe to the same queue and process that message). How exactly does this work? Let&#8217;s explore this in this tutorial!<\/p>\n<p>First, I&#8217;ll create a new Maven multi-module project as an example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25247 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-1.png\" alt=\"\" width=\"700\" height=\"536\" \/><\/p>\n<p>Both the producer and consumer projects are Spring Boot projects that use Spring Cloud Starter Stream Rabbit to send and receive messages to RabbitMQ using Spring Cloud Stream.<\/p>\n<p>For example, to illustrate the partitioning part, we will have a producer application to publish messages to the exchange with three different partitions. We will run three instances of the consumer application to consume messages from these three different partitions.<\/p>\n<p>The RabbitMQ server information will be defined in the two projects as follows:<\/p>\n<pre class=\"lang:yaml decode:true \">spring:\r\n  rabbitmq:\r\n    host: localhost\r\n    port: 5672\r\n    username: guest\r\n    password: guest<\/pre>\n<p><strong>For the producer part<\/strong>, I will use the StreamBridge class to send messages as follows:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.springcloudstream;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.boot.CommandLineRunner;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.cloud.stream.function.StreamBridge;\r\nimport org.springframework.context.annotation.Bean;\r\n\r\n@SpringBootApplication\r\npublic class ProducerApplication {\r\n\r\n  @Autowired\r\n  private StreamBridge streamBridge;\r\n\r\n  public static void main(String[] args) {\r\n    SpringApplication.run(ProducerApplication.class, args);\r\n  }\r\n\r\n  @Bean\r\n  CommandLineRunner runner() {\r\n    return args -&gt; {\r\n      streamBridge.send(\"sendMessage\", new Order(100L, \"Laptop\"));\r\n      streamBridge.send(\"sendMessage\", new Order(101L, \"Phone\"));\r\n      streamBridge.send(\"sendMessage\", new Order(102L, \"Keyboard\"));\r\n      streamBridge.send(\"sendMessage\", new Order(100L, \"Mouse\"));\r\n    };\r\n  }\r\n}\r\n<\/pre>\n<p>As you can see, I&#8217;m using the `send()` method of the StreamBridge class to send a message to RabbitMQ using the binding name `sendMessage`. The content of the `Order` class is as follows:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.springcloudstream;\r\n\r\npublic record Order(Long userId, String product) {\r\n}<\/pre>\n<p>For the binding part, in the application.yml file, in addition to defining the binding for the `sendMessage` binding name to RabbitMQ&#8217;s `exchange`, you also need to define the following two properties:<\/p>\n<pre class=\"lang:java mark:13-15 decode:true \">spring:\r\n  rabbitmq:\r\n    host: localhost\r\n    port: 5672\r\n    username: guest\r\n    password: guest\r\n\r\n  cloud:\r\n    stream:\r\n      bindings:\r\n        sendMessage:\r\n          destination: message.exchange\r\n          producer:\r\n            partition-key-expression: payload.userId\r\n            partition-count: 3<\/pre>\n<p>We will use the property <code>spring.cloud.stream.bindings.&lt;binding-name&gt;.producer.partition-count<\/code> to define the number of partitions we want and the property <code>spring.cloud.stream.bindings.&lt;binding-name&gt;.producer.partition-key-expression<\/code> to define the routing key, so that Spring Cloud Stream can route messages related to a specific partition.<\/p>\n<p><strong>For the consumer part<\/strong>, we will define a bean for the Consumer interface to receive messages from RabbitMQ:<\/p>\n<pre class=\"lang:java decode:true \">@Bean\r\npublic Consumer&lt;Order&gt; processOrder() {\r\n  return order -&gt; {\r\n    System.out.println(\"Received: \" + order);\r\n  };\r\n}<\/pre>\n<p>The content of the Order class is the same as in the producer section!<\/p>\n<p>We also define the binding information and some other properties related to partitioning in the application.yml file as follows:<\/p>\n<pre class=\"lang:yaml decode:true \">spring:\r\n  cloud:\r\n    stream:\r\n      bindings:\r\n        processOrder-in-0:\r\n          destination: message.exchange\r\n          group: huongdanjava\r\n          consumer:\r\n            partitioned: true\r\n      instance-count: 3<\/pre>\n<p>The property `spring.cloud.stream.binding.&lt;binding-name&gt;.consumer.partitioned` tells Spring Cloud Stream that we want to enable partitioning for this consumer application. The property `spring.cloud.stream.binding.instance-count` defines the number of partitions. Additionally, there&#8217;s another property called `spring.cloud.stream.instance-index` that we&#8217;ll use when running the consumer application to mark the corresponding consumer instance number.<\/p>\n<p>In my example, I&#8217;ll be running one producer application and three instances of the consumer application, so to avoid port conflicts, I&#8217;ll define the `server.port` property with a value of 0:<\/p>\n<pre class=\"lang:java decode:true \">server.port = 0<\/pre>\n<p>so that these applications can run using random ports.<\/p>\n<p>For the consumer application, I will run 3 instances with the property <code>spring.cloud.stream.instance-index<\/code>, for example, instance 1 as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25248 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-2.png\" alt=\"\" width=\"700\" height=\"594\" \/><\/p>\n<p>You can run the producer application like a normal Spring Boot application!<\/p>\n<p>Now, after running the three consumer instances and finally the producer application, you will see the results for each consumer instance as follows:<\/p>\n<p>Consumer 1:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25249 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-3.png\" alt=\"\" width=\"700\" height=\"194\" \/><\/p>\n<p>Consumer 2:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25250 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-4.png\" alt=\"\" width=\"700\" height=\"192\" \/><\/p>\n<p>Consumer 3:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25251 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-5.png\" alt=\"\" width=\"700\" height=\"193\" \/><\/p>\n<p>If you run the producer application multiple times, you&#8217;ll see that all the related messages are consumed by a specific consumer, for example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25252 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-6.png\" alt=\"\" width=\"700\" height=\"196\" \/><\/p>\n<p>If you check the queue information in RabbitMQ, you will see that Spring Cloud Stream has automatically created 3 queues corresponding to the 3 partitions we want:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25253 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/06\/partitioning-with-rabbitmq-using-spring-cloud-stream-7.png\" alt=\"\" width=\"1073\" height=\"381\" \/><\/p>\n<p>Essentially, each consumer instance will subscribe to a queue corresponding to its consumer instance number, and the relevant messages will be published to each queue!<\/p>\n<p>So, in this tutorial, I&#8217;ve shown you how to implement partitioning with RabbitMQ using Spring Cloud Stream. The process is similar for message brokers that Spring Cloud Stream supports!<\/p>\n<p><strong>Watch the video here:<\/strong><\/p>\n<p><iframe loading=\"lazy\" title=\"RabbitMQ Partitioning with Spring Cloud Stream | Scale Consumers Like a Pro\" width=\"825\" height=\"619\" src=\"https:\/\/www.youtube.com\/embed\/ET80Sw76VXY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;25245&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Partitioning with RabbitMQ using Spring Cloud Stream&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Partitioning in message queues is a mechanism that divides topics or queues into multiple partitions. Each partition stores a portion of the data, and this data is processed in parallel. This makes receiving and processing messages faster and more efficient! Apache Kafka supports partitioning natively,&hellip; <a href=\"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":25085,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2553],"tags":[],"class_list":["post-25245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-cloud-stream-en","clearfix"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Partitioning with RabbitMQ using Spring Cloud Stream - Huong Dan Java<\/title>\n<meta name=\"description\" content=\"In this tutorial, I guide you all on how to implement partitioning with RabbitMQ using Spring Cloud Stream.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Partitioning with RabbitMQ using Spring Cloud Stream - Huong Dan Java\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I guide you all on how to implement partitioning with RabbitMQ using Spring Cloud Stream.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\" \/>\n<meta property=\"og:site_name\" content=\"Huong Dan Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-03T11:48:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-03T11:49:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/04\/spring-cloud.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Khanh Nguyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/KhanhNguyenJ\" \/>\n<meta name=\"twitter:site\" content=\"@KhanhNguyenJ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khanh Nguyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\"},\"author\":{\"name\":\"Khanh Nguyen\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"headline\":\"Partitioning with RabbitMQ using Spring Cloud Stream\",\"datePublished\":\"2026-06-03T11:48:36+00:00\",\"dateModified\":\"2026-06-03T11:49:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\"},\"wordCount\":672,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/spring-cloud.jpg\",\"articleSection\":[\"Spring Cloud Stream\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\",\"name\":\"Partitioning with RabbitMQ using Spring Cloud Stream - Huong Dan Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/spring-cloud.jpg\",\"datePublished\":\"2026-06-03T11:48:36+00:00\",\"dateModified\":\"2026-06-03T11:49:22+00:00\",\"description\":\"In this tutorial, I guide you all on how to implement partitioning with RabbitMQ using Spring Cloud Stream.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/spring-cloud.jpg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/spring-cloud.jpg\",\"width\":400,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/huongdanjava.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Partitioning with RabbitMQ using Spring Cloud Stream\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/\",\"name\":\"Huong Dan Java\",\"description\":\"Java development tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/huongdanjava.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\",\"name\":\"Khanh Nguyen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"width\":1267,\"height\":1517,\"caption\":\"Khanh Nguyen\"},\"logo\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\"},\"description\":\"I love Java and everything related to Java.\",\"sameAs\":[\"https:\\\/\\\/huongdanjava.com\",\"https:\\\/\\\/www.facebook.com\\\/nhkhanh2406\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/KhanhNguyenJ\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Partitioning with RabbitMQ using Spring Cloud Stream - Huong Dan Java","description":"In this tutorial, I guide you all on how to implement partitioning with RabbitMQ using Spring Cloud Stream.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html","og_locale":"en_US","og_type":"article","og_title":"Partitioning with RabbitMQ using Spring Cloud Stream - Huong Dan Java","og_description":"In this tutorial, I guide you all on how to implement partitioning with RabbitMQ using Spring Cloud Stream.","og_url":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html","og_site_name":"Huong Dan Java","article_publisher":"https:\/\/www.facebook.com\/nhkhanh2406","article_author":"https:\/\/www.facebook.com\/nhkhanh2406","article_published_time":"2026-06-03T11:48:36+00:00","article_modified_time":"2026-06-03T11:49:22+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/04\/spring-cloud.jpg","type":"image\/jpeg"}],"author":"Khanh Nguyen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/KhanhNguyenJ","twitter_site":"@KhanhNguyenJ","twitter_misc":{"Written by":"Khanh Nguyen","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#article","isPartOf":{"@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html"},"author":{"name":"Khanh Nguyen","@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"headline":"Partitioning with RabbitMQ using Spring Cloud Stream","datePublished":"2026-06-03T11:48:36+00:00","dateModified":"2026-06-03T11:49:22+00:00","mainEntityOfPage":{"@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html"},"wordCount":672,"commentCount":0,"publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"image":{"@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/04\/spring-cloud.jpg","articleSection":["Spring Cloud Stream"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html","url":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html","name":"Partitioning with RabbitMQ using Spring Cloud Stream - Huong Dan Java","isPartOf":{"@id":"https:\/\/huongdanjava.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage"},"image":{"@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/04\/spring-cloud.jpg","datePublished":"2026-06-03T11:48:36+00:00","dateModified":"2026-06-03T11:49:22+00:00","description":"In this tutorial, I guide you all on how to implement partitioning with RabbitMQ using Spring Cloud Stream.","breadcrumb":{"@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#primaryimage","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/04\/spring-cloud.jpg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2026\/04\/spring-cloud.jpg","width":400,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/huongdanjava.com\/partitioning-with-rabbitmq-using-spring-cloud-stream.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/huongdanjava.com\/"},{"@type":"ListItem","position":2,"name":"Partitioning with RabbitMQ using Spring Cloud Stream"}]},{"@type":"WebSite","@id":"https:\/\/huongdanjava.com\/#website","url":"https:\/\/huongdanjava.com\/","name":"Huong Dan Java","description":"Java development tutorials","publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/huongdanjava.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d","name":"Khanh Nguyen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","width":1267,"height":1517,"caption":"Khanh Nguyen"},"logo":{"@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg"},"description":"I love Java and everything related to Java.","sameAs":["https:\/\/huongdanjava.com","https:\/\/www.facebook.com\/nhkhanh2406","https:\/\/x.com\/https:\/\/twitter.com\/KhanhNguyenJ"]}]}},"_links":{"self":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/25245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/comments?post=25245"}],"version-history":[{"count":4,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/25245\/revisions"}],"predecessor-version":[{"id":25256,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/25245\/revisions\/25256"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media\/25085"}],"wp:attachment":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media?parent=25245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/categories?post=25245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/tags?post=25245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}