Skip to content

Instantly share code, notes, and snippets.

View lukebakken's full-sized avatar

Luke Bakken lukebakken

View GitHub Profile
@lukebakken
lukebakken / .gitignore
Created July 19, 2018 15:52 — forked from MarcialRosales/Readme.md
Gather consumer channel information from RabbitMQ in order to troubleshoot an issue with unexpected unacknowledged messages
*.beam
@lukebakken
lukebakken / .gitignore
Last active July 17, 2018 22:41
PerfTest connection recovery
*env*/
*.pcap*
logs/
rabbitmq-perf-test*/
toxiproxy-*-amd64
@lukebakken
lukebakken / Vagrantfile
Last active November 19, 2020 03:54
Ubuntu 16 + RabbitMQ
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive
echo "deb https://dl.bintray.com/rabbitmq/debian xenial main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
dpkg -i erlang-solutions_1.0_all.deb
apt-get -yq update

Setup

Clone tls-gen, then in the two_shared_intermediates sub-directory:

make CN=HOSTNAME_1
cp result/* path/to/root_ca_1
make clean
make CN=HOSTNAME_2
cp result/* path/to/root_ca_2

Run PerfTest with the following arguments:

--rate 1 --producers 1 --consumers 1 --exchange gh-976 --routing-key gh-976
// This example declares a durable Exchange, an ephemeral (auto-delete) Queue,
// binds the Queue to the Exchange with a binding key, and consumes every
// message published to that Exchange with that routing key.
//
package main
import (
"flag"
"fmt"
"github.com/streadway/amqp"
import logging
from pika import SelectConnection, URLParameters
from threading import Thread
from time import sleep
from argparse import ArgumentParser
class AsyncConnection():
def __init__(self, host):
self.connection_params = URLParameters('amqp://guest:guest@{}:5672/%2F'.format(host))
self.log = logging.getLogger(self.__class__.__name__)