import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"; import CodeBlock from "@theme/CodeBlock";
This guide walks you through how you can install Busly CLI, which was built from the ground up for cross-platform compatibility and offers a variety of installation options to suit different environments and use cases.
Busly CLI was built from the ground up for cross-platform compatibility and offers a variety of installation options to suit different environments and use cases.
choco install busly-cli -yTo pull the busy-cli image and run it as a Docker container:
docker pull tragiccode/busly-cli
docker run --rm tragiccode/busly-cli --helpdotnet tool install --global dotnet-busly
dotnet-busly --helpDownload the latest release Here
Next, lets configure a rabbitmq transport called local-rabbitmq that will tell the cli how to send messages to RabbitMQ running in a docker container on our local computer.
current-transport: local-rabbitmq
transports:
- name: local-rabbitmq
rabbitmq-transport-config:
amqp-connection-string: amqp://localhost
management-api:
url: http://localhost:15672To confirm that your configuration file is valid and that busly-cli is using the local-rabbitmq transport by running:
busly transport current:::note This guide uses RabbitMQ for simplicity, but Busly supports multiple NServiceBus transports.
Check out the Transports section for other options. :::
The quickest way to get RabbitMQ running on your machine is using Docker. Run the following command:
docker run -d \
--name rabbitmq \
-p 5672:5672 \
-p 15672:15672 \
rabbitmq:4-managementOnce the container is running, open the RabbitMQ Management UI in your browser at http://localhost:15672 and log in with the default credentials, username: guest and password: guest, to verify that RabbitMQ is running correctly.
Before sending messages with Busly, you need an active endpoint connected to your configured transport.
To make this easy, Busly provides a demo mode, which automatically creates and runs an NServiceBus endpoint using your current transport configuration.
Run the following command to start the demo endpoint
busly demo start- Creates and starts an NServiceBus endpoint named
BuslyDemousing your transport configuration. - Allows Busly to receive any command sent to it.
- Automatically subscribes to a single event:
Messages.Events.OrderPlaced
:::warning
Demo mode is intended strictly for this quick-start guide. Using it outside of this context is highly discouraged, as it will attempt to create queues and exchanges in whatever transport is currently configured. If your current transport happens to be pointed production or shared environments this will not be ideal.
:::
busly command send \
--content-type 'text/json' \
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.CreateOrder" \
--destination-endpoint BusCLI.GettingStarted.Endpoint \
--message-body '{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'busly command send `
--content-type 'text/json' `
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.CreateOrder" `
--destination-endpoint BusCLI.GettingStarted.Endpoint `
--message-body ('{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'-replace '"', '\"')busly event publish `
--content-type 'text/json' `
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.OrderCreated" `
--message-body '{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'busly event publish `
--content-type 'text/json' `
--enclosed-message-type "BusyCLI.GettingStarted.Endpoint.OrderCreated" `
--message-body ('{"OrderNumber":"3f2d6c8a-b7a2-4c3f-9c3e-12ab45ef6789"}'-replace '"', '\"')