All Projects → RamblingCookieMonster → RabbitMQTools

RamblingCookieMonster / RabbitMQTools

Licence: MIT license
PowerShell module containing cmdlets to manage RabbitMQ.

Projects that are alternatives of or similar to RabbitMQTools

Foundatio
Pluggable foundation blocks for building distributed apps.
Stars: ✭ 1,365 (+4955.56%)
Mutual labels:  queue, messaging, message-bus
Nsq
A realtime distributed messaging platform (forked from https://github.com/nsqio/nsq)
Stars: ✭ 476 (+1662.96%)
Mutual labels:  queue, messaging
Nsq
A realtime distributed messaging platform
Stars: ✭ 20,663 (+76429.63%)
Mutual labels:  queue, messaging
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-33.33%)
Mutual labels:  queue, messaging
psched
Priority-based Task Scheduling for Modern C++
Stars: ✭ 59 (+118.52%)
Mutual labels:  queue, queueing
queue
A queue-interop compatible Queueing library
Stars: ✭ 25 (-7.41%)
Mutual labels:  queue, queueing
Jocko
Kafka implemented in Golang with built-in coordination (No ZK dep, single binary install, Cloud Native)
Stars: ✭ 4,445 (+16362.96%)
Mutual labels:  queue, messaging
gobroker
golang wrapper for all (to-be) kinds of message brokers
Stars: ✭ 15 (-44.44%)
Mutual labels:  queue, messaging
Garagemq
AMQP message broker implemented with golang
Stars: ✭ 153 (+466.67%)
Mutual labels:  queue, messaging
Lightbus
RPC & event framework for Python 3
Stars: ✭ 149 (+451.85%)
Mutual labels:  queue, messaging
Foundatio.Samples
Foundatio Samples
Stars: ✭ 34 (+25.93%)
Mutual labels:  queue, message-bus
Message Bus
Go simple async message bus
Stars: ✭ 166 (+514.81%)
Mutual labels:  queue, message-bus
azure-service-bus-go
Golang library for Azure Service Bus -- https://aka.ms/azsb
Stars: ✭ 67 (+148.15%)
Mutual labels:  queue, messaging
Tesseract
A set of libraries for rapidly developing Pipeline driven micro/macroservices.
Stars: ✭ 20 (-25.93%)
Mutual labels:  queue, queueing
ansible-role-rabbitmq
Ansible Role - RabbitMQ
Stars: ✭ 49 (+81.48%)
Mutual labels:  queue, rabbitmq-server
horse-messaging
Open Source Messaging Framework. Queues, Channels, Events, Transactions, Distributed Cache
Stars: ✭ 65 (+140.74%)
Mutual labels:  queue, messaging
Nats.c
A C client for NATS
Stars: ✭ 220 (+714.81%)
Mutual labels:  messaging, message-bus
filequeue
light weight, high performance, simple, reliable and persistent queue for Java applications
Stars: ✭ 35 (+29.63%)
Mutual labels:  queue, queueing
Workq
Job server in Go
Stars: ✭ 1,546 (+5625.93%)
Mutual labels:  queue, queueing
Laravel Queue
Laravel Enqueue message queue extension. Supports AMQP, Amazon SQS, Kafka, Google PubSub, Redis, STOMP, Gearman, Beanstalk and others
Stars: ✭ 155 (+474.07%)
Mutual labels:  queue, messaging

Build status

RabbitMQTools

This module provides a set of cmdlets to manage RabbitMQ through the REST API. It was originally written by @mariuszwojcik, with slight modifications from @ramblingcookiemonster.

A brief walk through on some basic components of this module are included in the RabbitMQ and PowerShell post.

Instructions

Download, unblock, and copy the module folder to a valid module path.

# Download RabbitMqTools
# https://github.com/RamblingCookieMonster/RabbitMQTools/archive/master.zip
# Unblock the archive
# Copy the RabbitMQTools module to one of your module paths ($env:PSModulePath -split ";")

# Alternatively, with PowerShell 5, or PowerShellGet:
    Install-Module RabbitMQTools

#Import the module
    Import-Module RabbitMQTools -force

#Get commands from the module
    Get-Command -module RabbitMQTools

#Get help for a command
    Get-Help Get-RabbitMQOverview
   
#Can you hit the server?
    Get-RabbitMQOverview -BaseUri "https://rabbitmq.contoso.com:15671" -Credential (Get-Credential)

Example

#Import the module
    Import-Module RabbitMQTools -force

#Define some credentials.  You need an account on RabbitMQ server before we can do this
    $credRabbit = Get-Credential
 
#Convenience - tab completion support for BaseUri
    Register-RabbitMQServer -BaseUri "https://rabbitmq.contoso.com:15671"
 
#I don't want to keep typing those common parameters... we'll splat them
    $Params = @{
        BaseUri = "https://rabbitmq.contoso.com:15671"
        Credential = $credRabbit
    }
 
#Can you hit the server?
    Get-RabbitMQOverview @params
 
#This shows how to create an Exchange and a Queue
#Think of the Exchange as the Blue USPS boxes, and a queue as the individual mailboxes the Exchanges route messages to
    $ExchangeName = "TestFanExc"
    $QueueName = 'TestQueue'
 
#Create an exchange
    Add-RabbitMQExchange @params -name $ExchangeName -Type fanout -Durable -VirtualHost /
 
#Create a queue for the exchange - / is a vhost initialized with install
    Add-RabbitMQQueue @params -Name $QueueName -Durable -VirtualHost /
 
#Bind them
    Add-RabbitMQQueueBinding @params -ExchangeName $ExchangeName -Name $QueueName -VirtualHost / -RoutingKey TestQueue
 
#Add a message to the exchange
    $message = [pscustomobject]@{samaccountname='cmonster';home='\\server\cmonster$'} | ConvertTo-Json
    Add-RabbitMQMessage @params -VirtualHost / -ExchangeName $ExchangeName -RoutingKey TestQueue -Payload $Message
 
#View your changes:
    Get-RabbitMQExchange @params
    Get-RabbitMQQueue @params
    Get-RabbitMQQueueBinding @params -Name $QueueName
 
#View the message we added:
    Get-RabbitMQMessage @params -VirtualHost / -Name $QueueName
    <#
 
        # = the number in the queue
        Queue = name of the queue
        R = whether we've read it (blank when you first read it, * if something has read it)
        Payload = your content.  JSON is helpful here.
 
              # Queue                R Payload
            --- -----                - -------
              1 TestQueue            * {...
    #>
 
#View the payload for the message we added:
    Get-RabbitMQMessage @params -VirtualHost / -Name $QueueName | Select -ExpandProperty Payload

    <#
        JSON output:

        {
            "samaccountname":  "cmonster",
            "home":  "\\\\server\\cmonster$"
        }
    #>

#Example processing the message
    $Incoming = Get-RabbitMQMessage @params -VirtualHost / -Name $QueueName -count 1 -Remove
    $IncomingData = $Incoming.payload | ConvertFrom-Json
    #If something fails, add the message back, or handle with other logic...

    #It's gone
    Get-RabbitMQMessage @params -VirtualHost / -Name $QueueName -count 1
 
    #We have our original data back...
    $IncomingData
 
    #There are better ways to handle this, illustrative purposes only : )
 
#Remove the Queue
    Remove-RabbitMQQueue @params -Name $QueueName -VirtualHost /
 
#Remove the Exchange
    Remove-RabbitMQExchange @params -ExchangeName $ExchangeName -VirtualHost /
 
#Verify that the queueu and Exchange are gone:
    Get-RabbitMQExchange @params
    Get-RabbitMQQueue @params

What can I do with it?

There is a set of cmdlets to manage the server, such as:

  • Get-RabbitMQOverview
  • Get-RabbitMQNode
  • Get-RabbitMQConnection
  • Get-RabbitMQChannel
  • Get-RabbitMQVirtualHost, Add-RabbitMQVirtualHost, Remove-RabbitMQVirtualHost
  • Get-RabbitMQExchage, Add-RabbitMQExchange, Remove-RabbitMQExchange
  • Get-RabbitMQQueue, Add-RabbitMQQueue, Remove-RabbitMQQueue
  • Get-RabbitMQMessage

To learn more about a cmdlet, or to see some examples run get-help cmdlet_name

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].