Skip to content

CLI tool for send/recieve messages to Azure Service Bus Queue

License

Notifications You must be signed in to change notification settings

groovy-sky/azbusqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Service Bus Queue CLI

Introduction

This Go package provides a simple command-line interface (CLI) tool for interacting with Azure Service Bus Queue. It allows you to send/receive messages from/to a queue.

Getting started

Prerequisites

Installation

If you want to try out the tool, you'll need to:

  1. Deploy Azure Service Bus and create a queue.
  2. Install the tool.

Easiest way how-to do that is to use the Azure CLI and execute script.sh file:

wget https://raw.githubusercontent.com/groovy-sky/service-bus-queue-cli/main/script.sh
chmod +x script.sh
./script.sh

Examples

Once you have created a queue, you can use the tool to send/receive messages from/to the queue. At first you'll need to set the AZURE_SERVICEBUS_CONNECTION_STRING environment variable to your Azure Service Bus connection string. Here's how you can do it:

export AZURE_SERVICEBUS_CONNECTION_STRING="your-connection-string"

After that you can use the tool to send/receive messages from/to a queue.

Send message

To send a message(subject and reply-to are optional):

azbusqueue send --queue your-queue-name --message "Your message" --subject "Your subject" --replyto "Your reply-to"

Receive message

To receive a message from a queue:

azbusqueue read --queue your-queue-name