Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions sidebarsTutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,42 @@ const sidebars = {
},
]
},
{
type: 'category',
label: 'Java (AMQP 1.0)',
items: [
{
type: 'doc',
id: 'tutorial-one-java-amqp10',
label: 'Hello World',
},
{
type: 'doc',
id: 'tutorial-two-java-amqp10',
label: 'Work Queues',
},
{
type: 'doc',
id: 'tutorial-three-java-amqp10',
label: 'Publish/Subscribe',
},
{
type: 'doc',
id: 'tutorial-four-java-amqp10',
label: 'Routing',
},
{
type: 'doc',
id: 'tutorial-five-java-amqp10',
label: 'Topics',
},
{
type: 'doc',
id: 'tutorial-six-java-amqp10',
label: 'RPC',
},
]
},
{
type: 'category',
label: 'Kotlin',
Expand Down Expand Up @@ -255,6 +291,42 @@ const sidebars = {
},
]
},
{
type: 'category',
label: '.NET (AMQP 1.0)',
items: [
{
type: 'doc',
id: 'tutorial-one-dotnet-amqp10',
label: 'Hello World',
},
{
type: 'doc',
id: 'tutorial-two-dotnet-amqp10',
label: 'Work Queues',
},
{
type: 'doc',
id: 'tutorial-three-dotnet-amqp10',
label: 'Publish/Subscribe',
},
{
type: 'doc',
id: 'tutorial-four-dotnet-amqp10',
label: 'Routing',
},
{
type: 'doc',
id: 'tutorial-five-dotnet-amqp10',
label: 'Topics',
},
{
type: 'doc',
id: 'tutorial-six-dotnet-amqp10',
label: 'RPC',
},
]
},
{
type: 'category',
label: 'JavaScript',
Expand Down Expand Up @@ -327,6 +399,42 @@ const sidebars = {
},
]
},
{
type: 'category',
label: 'Go (AMQP 1.0)',
items: [
{
type: 'doc',
id: 'tutorial-one-go-amqp10',
label: 'Hello World',
},
{
type: 'doc',
id: 'tutorial-two-go-amqp10',
label: 'Work Queues',
},
{
type: 'doc',
id: 'tutorial-three-go-amqp10',
label: 'Publish/Subscribe',
},
{
type: 'doc',
id: 'tutorial-four-go-amqp10',
label: 'Routing',
},
{
type: 'doc',
id: 'tutorial-five-go-amqp10',
label: 'Topics',
},
{
type: 'doc',
id: 'tutorial-six-go-amqp10',
label: 'RPC',
},
]
},
{
type: 'category',
label: 'Elixir',
Expand Down
105 changes: 103 additions & 2 deletions tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import T1DiagramToC from '@site/src/components/Tutorials/T1DiagramToC.md';
import T2DiagramToC from '@site/src/components/Tutorials/T2DiagramToC.md';
import T3DiagramToC from '@site/src/components/Tutorials/T3DiagramToC.md';
Expand All @@ -41,15 +44,111 @@ please see the [installation guide](/docs/download) or use the [community Docker
Executable versions of these tutorials [are open source](https://github.com/rabbitmq/rabbitmq-tutorials),
as is [this website](https://github.com/rabbitmq/rabbitmq-website).

There are two groups of tutorials:
There are three groups of tutorials:

* [RabbitMQ queues](#queue-tutorials)
* [RabbitMQ queues with AMQP 1.0](#queue-amqp-tutorials)
* [RabbitMQ queues with AMQP 0.9.1](#queue-tutorials)
* [RabbitMQ streams](#stream-tutorials)

:::info
This tutorials target RabbitMQ 4.x.
:::

<Tabs groupId="protocol">
<TabItem value="amqp-10" label="AMQP 1.0" default>

### <a id='queue-amqp-tutorials'></a> Queue tutorials with AMQP 1.0

This section covers the modern messaging protocol in RabbitMQ, AMQP 1.0. This protocol works
out of the box, without enabling any plugin.

<table id="tutorials-amqp10">
<colgroup>
<col span="1" style={{width: '33%',}}/>
<col span="1" style={{width: '33%',}}/>
<col span="1" style={{width: '33%',}}/>
</colgroup>

<tr>
<td id="tutorial-one" style={{verticalAlign: 'top',}}>
## 1. "Hello World!"

The simplest thing that does *something*

<T1DiagramToC/>

* [Java](tutorials/tutorial-one-java-amqp10)
* [C#](tutorials/tutorial-one-dotnet-amqp10)
* [Go](tutorials/tutorial-one-go-amqp10)
</td>

<td id="tutorial-two" style={{verticalAlign: 'top',}}>
## 2. Work Queues

Distributing tasks among workers (the <a href="http://www.enterpriseintegrationpatterns.com/patterns/messaging/CompetingConsumers.html" target="_blank">competing consumers pattern</a>)

<T2DiagramToC/>

* [Java](tutorials/tutorial-two-java-amqp10)
* [C#](tutorials/tutorial-two-dotnet-amqp10)
* [Go](tutorials/tutorial-two-go-amqp10)
</td>

<td id="tutorial-three" style={{verticalAlign: 'top',}}>
## 3. Publish/Subscribe

Sending messages to many consumers at once

<T3DiagramToC/>

* [Java](tutorials/tutorial-three-java-amqp10)
* [C#](tutorials/tutorial-three-dotnet-amqp10)
* [Go](tutorials/tutorial-three-go-amqp10)
</td>
</tr>

<tr>
<td id="tutorial-four" style={{verticalAlign: 'top',}}>
## 4. Routing

Receiving messages selectively

<T4DiagramToC/>

* [Java](tutorials/tutorial-four-java-amqp10)
* [C#](tutorials/tutorial-four-dotnet-amqp10)
* [Go](tutorials/tutorial-four-go-amqp10)
</td>

<td id="tutorial-five" style={{verticalAlign: 'top',}}>
## 5. Topics

Receiving messages based on a pattern (topics)

<T5DiagramToC/>

* [Java](tutorials/tutorial-five-java-amqp10)
* [C#](tutorials/tutorial-five-dotnet-amqp10)
* [Go](tutorials/tutorial-five-go-amqp10)
</td>

<td id="tutorial-six" style={{verticalAlign: 'top',}}>
## 6. RPC

<a href="http://www.enterpriseintegrationpatterns.com/patterns/messaging/RequestReply.html" target="_blank">Request/reply pattern</a> example

<T6DiagramToC/>

* [Java](tutorials/tutorial-six-java-amqp10)
* [C#](tutorials/tutorial-six-dotnet-amqp10)
* [Go](tutorials/tutorial-six-go-amqp10)
</td>
</tr>
</table>

</TabItem>

<TabItem value="amqp-091" label="AMQP 0-9-1">

### Queue tutorials

Expand Down Expand Up @@ -211,6 +310,8 @@ and take a look at the [Compatibility and Conformance page](/docs/specification)
to find relevant resources to learn more about AMQP 1.0 and AMQP 0-9-1,
the two core protocols implemented by RabbitMQ.

</TabItem>
</Tabs>

## Stream tutorials

Expand Down
58 changes: 58 additions & 0 deletions tutorials/tutorial-five-dotnet-amqp10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: RabbitMQ tutorial - Topics (AMQP 1.0)
---
<!--
Copyright (c) 2005-2026 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

All rights reserved. This program and the accompanying materials
are made available under the terms of the under the Apache License,
Version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

import TutorialsHelp from '@site/src/components/Tutorials/TutorialsHelp.md';
import T5DiagramToC from '@site/src/components/Tutorials/T5DiagramToC.md';
import T5DiagramTopicX from '@site/src/components/Tutorials/T5DiagramTopicX.md';

# RabbitMQ tutorial - Topics

## Topics
### (using the AMQP 1.0 .NET client)

<TutorialsHelp/>

<T5DiagramToC/>

In the [previous tutorial](./tutorial-four-dotnet-amqp10) we used a `direct` exchange to route by a single criterion (severity). **Topic** exchanges route by **patterns** in the routing key — useful when messages carry multiple dimensions (for example `kern.critical`).

<T5DiagramTopicX/>

The sample declares exchange `logs_topic` with type `topic`. The publisher sets the routing key on `PublisherBuilder().Exchange(exchangeName).Key(routingKey)`. The consumer passes one or more binding keys (patterns) on the command line and binds the temporary queue for each.

Topic binding rules:

- `*` substitutes exactly one word.
- `#` substitutes zero or more words.
- Words are separated by `.` in routing keys.

### Running

```bash
dotnet run --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "kern.*"
dotnet run --project EmitLogTopic/EmitLogTopic.csproj kern.critical "A critical kernel error"
```

### Source

- [`EmitLogTopic/Program.cs`](https://github.com/rabbitmq/rabbitmq-tutorials/blob/main/dotnet-amqp/EmitLogTopic/Program.cs)
- [`ReceiveLogsTopic/Program.cs`](https://github.com/rabbitmq/rabbitmq-tutorials/blob/main/dotnet-amqp/ReceiveLogsTopic/Program.cs)

Now we can move on to [tutorial 6](./tutorial-six-dotnet-amqp10) to learn about the RPC (request/reply) pattern with RabbitMQ.
Loading