Skip to content

Commit 4a2512e

Browse files
committed
Update quick start example to better show how to utilize docker
1 parent 220741c commit 4a2512e

File tree

3 files changed

+74
-11
lines changed

3 files changed

+74
-11
lines changed

src/BuslyCLI.Console/Commands/Demo/StartCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ public class StartDemoCommand(IAnsiConsole console, IRawEndpointFactory rawEndpo
1212
{
1313
public override async Task<int> ExecuteAsync(CommandContext context, CurrentTransportSettings settings, CancellationToken cancellationToken)
1414
{
15-
console.WriteLine("Starting demo endpoint for quick start guide...");
15+
console.WriteLine($"Starting demo endpoint named {Constants.DemoDefaultOriginatingEndpoint} for quick start guide...");
1616
var config = await nServiceBusConfiguration.GetValidatedConfigurationAsync(settings.Config.Path);
1717
var rawEndpoint = await rawEndpointFactory.CreateRawEndpoint(Constants.DemoDefaultOriginatingEndpoint, config.CurrentTransportConfig);
1818

1919
await rawEndpoint.StartEndpoint();
20+
console.WriteLine($"{Constants.DemoDefaultOriginatingEndpoint} Endpoint Started.");
2021
await rawEndpoint.Subscribe("Messages.Events.OrderPlaced", cancellationToken);
2122

2223
do

src/BuslyCLI.Console/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public static class Constants
44
{
55
public const string DefaultOriginatingEndpoint = "BuslyCLI";
6-
public const string DemoDefaultOriginatingEndpoint = "BuslyDemo";
6+
public const string DemoDefaultOriginatingEndpoint = $"{DefaultOriginatingEndpoint}.DemoEndpoint";
77
public const string DefaultConfigPath = "~/.busly-cli/config.yaml";
88

99
public static class NServiceBus

website/docs/getting-started/quick-start.mdx

Lines changed: 71 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ busly demo start
100100

101101
## What Demo Mode Does
102102

103-
- Creates and starts an NServiceBus endpoint named `BuslyDemo` using your transport configuration.
103+
- Creates and starts an NServiceBus endpoint named `BuslyCLI.DemoEndpoint` using your transport configuration.
104104
- Allows Busly to receive any command sent to it.
105105
- Automatically subscribes to a single event: `Messages.Events.OrderPlaced`
106106

@@ -119,8 +119,8 @@ Demo mode is intended strictly for this quick-start guide. Using it outside of t
119119
```bash
120120
busly command send \
121121
--content-type 'text/json' \
122-
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.CreateOrder" \
123-
--destination-endpoint BusCLI.GettingStarted.Endpoint \
122+
--enclosed-message-type "Messages.Commands.CreateOrder" \
123+
--destination-endpoint "BuslyCLI.DemoEndpoint" \
124124
--message-body '{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'
125125
```
126126

@@ -130,11 +130,43 @@ busly command send \
130130
```bash
131131
busly command send `
132132
--content-type 'text/json' `
133-
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.CreateOrder" `
134-
--destination-endpoint BusCLI.GettingStarted.Endpoint `
133+
--enclosed-message-type "Messages.Commands.CreateOrder" `
134+
--destination-endpoint "BuslyCLI.DemoEndpoint" `
135135
--message-body ('{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'-replace '"', '\"')
136136
```
137137

138+
</TabItem>
139+
<TabItem value="docker bash" label="Docker (Bash)">
140+
141+
```bash
142+
docker run --rm \
143+
--network host \
144+
-v "$HOME/.busly-cli/config.yaml:/app/config.yaml" \
145+
tragiccode/busly-cli \
146+
command send \
147+
--content-type "text/json" \
148+
--enclosed-message-type "Messages.Commands.CreateOrder" \
149+
--destination-endpoint "BuslyCLI.DemoEndpoint" \
150+
--message-body '{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}' \
151+
--config ./config.yaml
152+
```
153+
154+
</TabItem>
155+
<TabItem value="docker powershell" label="Docker (Powershell)">
156+
157+
```bash
158+
docker run --rm `
159+
--network host `
160+
-v "$HOME/.busly-cli/config.yaml:/app/config.yaml" `
161+
tragiccode/busly-cli `
162+
command send `
163+
--content-type "text/json" `
164+
--enclosed-message-type "Messages.Commands.CreateOrder" `
165+
--destination-endpoint "BuslyCLI.DemoEndpoint" `
166+
--message-body ('{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'-replace '"', '\"') `
167+
--config ./config.yaml
168+
```
169+
138170
</TabItem>
139171
</Tabs>
140172

@@ -144,9 +176,9 @@ busly command send `
144176
<TabItem value="bash" label="Bash">
145177

146178
```bash
147-
busly event publish `
148-
--content-type 'text/json' `
149-
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.OrderCreated" `
179+
busly event publish \
180+
--content-type 'text/json' \
181+
--enclosed-message-type "Messages.Events.OrderPlaced" \
150182
--message-body '{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'
151183
```
152184

@@ -156,9 +188,39 @@ busly event publish `
156188
```bash
157189
busly event publish `
158190
--content-type 'text/json' `
159-
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.OrderCreated" `
191+
--enclosed-message-type "Messages.Events.OrderPlaced" `
160192
--message-body ('{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'-replace '"', '\"')
161193
```
162194

195+
</TabItem>
196+
<TabItem value="docker bash" label="Docker (Bash)">
197+
198+
```bash
199+
docker run --rm \
200+
--network host \
201+
-v "$HOME/.busly-cli/config.yaml:/app/config.yaml" \
202+
tragiccode/busly-cli \
203+
event publish \
204+
--content-type "text/json" \
205+
--enclosed-message-type "Messages.Events.OrderPlaced" \
206+
--message-body '{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}' \
207+
--config ./config.yaml
208+
```
209+
210+
</TabItem>
211+
<TabItem value="docker powershell" label="Docker (Powershell)">
212+
213+
```bash
214+
docker run --rm `
215+
--network host `
216+
-v "$HOME/.busly-cli/config.yaml:/app/config.yaml" `
217+
tragiccode/busly-cli `
218+
event publish `
219+
--content-type "text/json" `
220+
--enclosed-message-type "Messages.Events.OrderPlaced" `
221+
--message-body ('{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'-replace '"', '\"') `
222+
--config ./config.yaml
223+
```
224+
163225
</TabItem>
164226
</Tabs>

0 commit comments

Comments
 (0)