{"id":27502,"date":"2023-08-29T12:07:42","date_gmt":"2023-08-29T10:07:42","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=27502"},"modified":"2024-09-11T10:18:27","modified_gmt":"2024-09-11T08:18:27","slug":"apache-kafka-consumer-group","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/","title":{"rendered":"Apache Kafka Consumer Group"},"content":{"rendered":"\n<p>On producer side, messages are load balanced across partition based on hashed key. On the consumer side, to ensure that each message is processed by only one consumer within the group, allowing for load balancing, fault tolerance, and efficient utilization of resources in a Kafka consumer application, there is the concept of consumer group.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-creation-of-consumer-group\">Creation of Consumer Group<\/h2>\n\n\n\n<p>There is no specific command to create a consumer group. You simply need to add <code>--group &lt;groupname&gt;<\/code> to the consumer command. For example:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ .\/bin\/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic events3p3r --from-beginning --property print.key=true --group consumergroup1\n<\/pre><\/div>\n\n\n<p>Kafka ensures that, even if you run this command with same group several times, each message will be consumed only once.<\/p>\n\n\n\n<p>By the way, the topic definition is as follow (same as previous <a href=\"https:\/\/www.dbi-services.com\/blog\/apache-kafka-concepts-by-example\/\" target=\"_blank\" rel=\"noreferrer noopener\">blog<\/a>, 3 partitions and 3 replicas):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nTopic: events3p3r       TopicId: jppdD6GfS1WjOSsNCJCtcQ PartitionCount: 3       ReplicationFactor: 3    Configs: segment.bytes=1073741824\n        Topic: events3p3r       Partition: 0    Leader: 3       Replicas: 3,1,2 Isr: 3,1,2\n        Topic: events3p3r       Partition: 1    Leader: 1       Replicas: 1,2,3 Isr: 1,2,3\n        Topic: events3p3r       Partition: 2    Leader: 2       Replicas: 2,3,1 Isr: 2,3,1\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-consumer-group-details\">Consumer Group Details<\/h2>\n\n\n\n<p>With help of <code>kafka-consumer-groups.sh<\/code>, it is possible to get insights of what is happening. To run it, I trigger following command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ .\/bin\/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group consumergroup1\n<\/pre><\/div>\n\n\n<p>And output looks like that:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nGROUP           TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                           HOST            CLIENT-ID\nconsumergroup1  events3p3r      0          0               0               0               console-consumer-bd4cfd50-1b79-490c-88b9-386421cad7e4 \/10.0.0.157     console-consumer\nconsumergroup1  events3p3r      1          0               0               0               console-consumer-bd4cfd50-1b79-490c-88b9-386421cad7e4 \/10.0.0.157     console-consumer\nconsumergroup1  events3p3r      2          0               0               0               console-consumer-bd4cfd50-1b79-490c-88b9-386421cad7e4 \/10.0.0.157     console-consumer\n<\/pre><\/div>\n\n\n<p>We can see the 3 partitions, currently without any data, being all read by same host (kafka-03 host IP).<\/p>\n\n\n\n<p>Let&#8217;s produce some messages and see what happens. I create a simple text file with this content:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n1:message1\n2:message2\n3:message3\n4:message4\n5:message5\n6:message6\n<\/pre><\/div>\n\n\n<p>And send them into the topic:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ cat messages | .\/bin\/kafka-console-producer.sh --bootstrap-server localhost:9092  --property &quot;key.separator=:&quot; --property &quot;parse.key=true&quot; --topic events3p3r\n<\/pre><\/div>\n\n\n<p>On the consumer side, we can see the messages:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@kafka-03 kafka]# .\/bin\/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic events3p3r --property print.key=true --group consumergroup1\n4       message4\n6       message6\n2       message2\n3       message3\n1       message1\n5       message5\n<\/pre><\/div>\n\n\n<p>Keep in mind that message order is kept only per partition and consumer currently polls from the 3 existing partitions, nothing prevent the miss order.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-add-more-consumers\">Add more Consumers<\/h2>\n\n\n\n<p>Let&#8217;s run 2 more consumers for a total of 3: One on first node (kafka-01) and another on second node (kafka-02) and check how consumer group changed:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nGROUP           TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                           HOST            CLIENT-ID\nconsumergroup1  events3p3r      0          2               2               0               console-consumer-571e4252-2aca-4a5d-918d-159a648dd10f \/10.0.0.133     console-consumer\nconsumergroup1  events3p3r      1          2               2               0               console-consumer-8201f7e5-80db-4d64-8886-75469cd8fcb9 \/10.0.0.194     console-consumer\nconsumergroup1  events3p3r      2          2               2               0               console-consumer-bd4cfd50-1b79-490c-88b9-386421cad7e4 \/10.0.0.157     console-consumer\n<\/pre><\/div>\n\n\n<p>We can observe that each consumer has an assigned partition.<\/p>\n\n\n\n<p>And consumes the corresponding data:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"361\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png\" alt=\"\" class=\"wp-image-27529\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-300x106.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-768x270.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1536x541.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-2048x721.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It is interesting to note that even if consumer is started with option <code>--from-beginning<\/code>, it will not get all messages as old messages were already consumed by another consumer of the group.<\/p>\n\n\n\n<p>Adding more consumer to the group than the amount of partitions in the topic will not increase consume performances. A consumer can read from multiple partitions, but a partition cannot be read from multiple consumers in the same consumer group. Partition can be read by multiple consumers if they are not part of the same consumer group.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-remove-consumers\">Remove Consumers<\/h2>\n\n\n\n<p>What happens to the consumer group when a consumer stops? Kafka will do a <mark class=\"has-inline-color has-vivid-cyan-blue-color\">rebalance<\/mark> of partitions between remaining consumers.<\/p>\n\n\n\n<p>Before a rebalance, with 3 consumers, we have:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ .\/bin\/kafka-consumer-groups.sh  --bootstrap-server localhost:9092 --describe --group consumergroup1 --members --verbose\n\nGROUP           CONSUMER-ID                                           HOST            CLIENT-ID        #PARTITIONS     ASSIGNMENT\nconsumergroup1  console-consumer-afca6731-9cf9-431e-b7bd-da43c84fcf31 \/10.0.0.194     console-consumer 1               events3p3r(1)\nconsumergroup1  console-consumer-9e26fae1-e04d-4541-8fa8-139d97856a70 \/10.0.0.157     console-consumer 1               events3p3r(0)\nconsumergroup1  console-consumer-b8257a20-72f2-4d69-b755-47d2cda2fc0c \/10.0.0.133     console-consumer 1               events3p3r(2)\n<\/pre><\/div>\n\n\n<p>After stopping the consumer on the first node:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nGROUP           CONSUMER-ID                                           HOST            CLIENT-ID        #PARTITIONS     ASSIGNMENT\nconsumergroup1  console-consumer-9e26fae1-e04d-4541-8fa8-139d97856a70 \/10.0.0.157     console-consumer 2               events3p3r(0,1)\nconsumergroup1  console-consumer-b8257a20-72f2-4d69-b755-47d2cda2fc0c \/10.0.0.133     console-consumer 1               events3p3r(2)\n<\/pre><\/div>\n\n\n<p>As you can see, one consumer is polling 2 partitions from events3p3r topic (partition 0 and 1).<\/p>\n\n\n\n<p>We can also see traces of this rebalance in server.log:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;2023-08-29 09:34:41,637] INFO &#x5B;GroupCoordinator 1]: Preparing to rebalance group consumergroup1 in state PreparingRebalance with old generation 27 (__consumer_offsets-24) (reason: Removing member console-consumer-a161b008-067f-42b7-a613-4f4449ee04f4 on LeaveGroup; client reason: the consumer is being closed) (kafka.coordinator.group.GroupCoordinator)\n&#x5B;2023-08-29 09:34:41,637] INFO &#x5B;GroupCoordinator 1]: Member MemberMetadata(memberId=console-consumer-a161b008-067f-42b7-a613-4f4449ee04f4, groupInstanceId=None, clientId=console-consumer, clientHost=\/10.0.0.194, sessionTimeoutMs=45000, rebalanceTimeoutMs=300000, supportedProtocols=List(range, cooperative-sticky)) has left group consumergroup1 through explicit `LeaveGroup`; client reason: the consumer is being closed (kafka.coordinator.group.GroupCoordinator)\n&#x5B;2023-08-29 09:34:44,522] INFO &#x5B;GroupCoordinator 1]: Stabilized group consumergroup1 generation 28 (__consumer_offsets-24) with 2 members (kafka.coordinator.group.GroupCoordinator)\n&#x5B;2023-08-29 09:34:44,524] INFO &#x5B;GroupCoordinator 1]: Assignment received from leader console-consumer-9e26fae1-e04d-4541-8fa8-139d97856a70 for group consumergroup1 for generation 28. The group has 2 members, 0 of which are static. (kafka.coordinator.group.GroupCoordinator)\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-group-coordinator-and-group-leader-roles\">Group Coordinator and Group Leader Roles<\/h2>\n\n\n\n<p>A broker endorses the group coordinator role. It oversees consumer liveness through heartbeat mechanism. If a consumer leaves group or timeout, group coordinator will trigger a rebalance. A rebalance will also occur when a new consumer subscribes to a topic with the same consumer group.<\/p>\n\n\n\n<p>The first consumer connecting to the consumer group assigns the <strong>group leader<\/strong> role. The leader receives the list of alive consumers from the group coordinator and then assigns partition(s) to each consumer. The group leader (ie. a consumer) assigns partitions to consumers because it is the consumer that knows best any business constraints on message (ordering, duplicates, losses).<\/p>\n\n\n\n<p>There are several types of <a href=\"https:\/\/kafka.apache.org\/documentation\/#consumerconfigs_partition.assignment.strategy\" target=\"_blank\" rel=\"noreferrer noopener\">assignors<\/a> available, but I will not cover them here. Maybe in another blog \ud83d\ude09 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>On producer side, messages are load balanced across partition based on hashed key. On the consumer side, to ensure that each message is processed by only one consumer within the group, allowing for load balancing, fault tolerance, and efficient utilization of resources in a Kafka consumer application, there is the concept of consumer group. Creation [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[3064,1103],"type_dbi":[],"class_list":["post-27502","post","type-post","status-publish","format-standard","hentry","category-application-integration-middleware","tag-apache-kafka","tag-kafka"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Apache Kafka Consumer Group - dbi Blog<\/title>\n<meta name=\"description\" content=\"What is a consumer group and could it help to better consume messages from a Kafka cluster?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Kafka Consumer Group\" \/>\n<meta property=\"og:description\" content=\"What is a consumer group and could it help to better consume messages from a Kafka cluster?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-29T10:07:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-11T08:18:27+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png\" \/>\n<meta name=\"author\" content=\"Middleware Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Middleware Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/\"},\"author\":{\"name\":\"Middleware Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d8563acfc6e604cce6507f45bac0ea1\"},\"headline\":\"Apache Kafka Consumer Group\",\"datePublished\":\"2023-08-29T10:07:42+00:00\",\"dateModified\":\"2024-09-11T08:18:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/\"},\"wordCount\":547,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/Kafka-consumers-1024x361.png\",\"keywords\":[\"Apache Kafka\",\"kafka\"],\"articleSection\":[\"Application integration &amp; Middleware\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/\",\"name\":\"Apache Kafka Consumer Group - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/Kafka-consumers-1024x361.png\",\"datePublished\":\"2023-08-29T10:07:42+00:00\",\"dateModified\":\"2024-09-11T08:18:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d8563acfc6e604cce6507f45bac0ea1\"},\"description\":\"What is a consumer group and could it help to better consume messages from a Kafka cluster?\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/Kafka-consumers-1024x361.png\",\"contentUrl\":\"http:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/Kafka-consumers-1024x361.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/apache-kafka-consumer-group\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache Kafka Consumer Group\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d8563acfc6e604cce6507f45bac0ea1\",\"name\":\"Middleware Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"caption\":\"Middleware Team\"},\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/middleware-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Apache Kafka Consumer Group - dbi Blog","description":"What is a consumer group and could it help to better consume messages from a Kafka cluster?","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:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/","og_locale":"en_US","og_type":"article","og_title":"Apache Kafka Consumer Group","og_description":"What is a consumer group and could it help to better consume messages from a Kafka cluster?","og_url":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/","og_site_name":"dbi Blog","article_published_time":"2023-08-29T10:07:42+00:00","article_modified_time":"2024-09-11T08:18:27+00:00","og_image":[{"url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png","type":"","width":"","height":""}],"author":"Middleware Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Middleware Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/"},"author":{"name":"Middleware Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"headline":"Apache Kafka Consumer Group","datePublished":"2023-08-29T10:07:42+00:00","dateModified":"2024-09-11T08:18:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/"},"wordCount":547,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#primaryimage"},"thumbnailUrl":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png","keywords":["Apache Kafka","kafka"],"articleSection":["Application integration &amp; Middleware"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/","url":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/","name":"Apache Kafka Consumer Group - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#primaryimage"},"thumbnailUrl":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png","datePublished":"2023-08-29T10:07:42+00:00","dateModified":"2024-09-11T08:18:27+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"description":"What is a consumer group and could it help to better consume messages from a Kafka cluster?","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#primaryimage","url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png","contentUrl":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/Kafka-consumers-1024x361.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/apache-kafka-consumer-group\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apache Kafka Consumer Group"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1","name":"Middleware Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","caption":"Middleware Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=27502"}],"version-history":[{"count":18,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27502\/revisions"}],"predecessor-version":[{"id":34724,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27502\/revisions\/34724"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=27502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=27502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=27502"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=27502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}