> For the complete documentation index, see [llms.txt](https://docs.kubemq.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kubemq.io/learn/the-basics/grouping.md).

# Grouping

## General

KubeMQ supports grouping receivers with the same subscription channel patterns to form a load balancing group.

## Consumer Groups

The group pattern is a useful pattern for sharing message load handling between services and for redundancy functionality too.

During a Subscription request, the receiver can set the group name to join or not. Based on the Group value setting KubeMQ will deliver messages to the receiver as follows:

* Any receiver without a group setting (group="", blank)
* Only one receiver for each group he belongs to

![](/files/-M2chJWqlu4TrXg-qcFP)

Example:

In the table below we have 8 receivers which subscribe to different channels and groups:

| Receiver Name | Channel   | Group |
| ------------- | --------- | ----- |
| R1            | `foo.>`   | `""`  |
| R2            | `foo.>`   | `g1`  |
| R3            | `foo.>`   | `g1`  |
| R4            | `foo.*`   | `g2`  |
| R5            | `foo.*`   | `g2`  |
| R6            | `>`       | `w1`  |
| R7            | `*`       | `""`  |
| R8            | `foo.bar` | `""`  |

In the table below, we explore several message channels and which receiver will get them:

| Sending Message to Channel | Receivers                      |
| -------------------------- | ------------------------------ |
| `foo`                      | R6,R7                          |
| `foo.bar`                  | R1, R2 or R3, R4 or R5, R6, R8 |
| `foo.bar.zoo`              | R1, R2 or R3, R6, R8           |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kubemq.io/learn/the-basics/grouping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
