Skip to content

Instantly share code, notes, and snippets.

View Gsantomaggio's full-sized avatar
🐒
Working from home

Gabriele Santomaggio Gsantomaggio

🐒
Working from home
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo "Installing Docker..."
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
echo '* libraries/restart-without-asking boolean true' | sudo debconf-set-selections
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@Gsantomaggio
Gsantomaggio / consumer.go
Created July 16, 2021 08:46
consumer.go
package main
import (
"fmt"
"github.com/rabbitmq/rabbitmq-stream-go-client/pkg/amqp"
"github.com/rabbitmq/rabbitmq-stream-go-client/pkg/stream"
"os"
"time"
)
#!/bin/sh
sudo apt-get install curl gnupg debian-keyring debian-archive-keyring apt-transport-https -y
## Team RabbitMQ's main signing key
sudo apt-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
## Launchpad PPA that provides modern Erlang releases
sudo apt-key adv --keyserver "keyserver.ubuntu.com" --recv-keys "F77F1EDA57EBB1CC"
## PackageCloud RabbitMQ repository
curl -1sLf 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey' | sudo apt-key add -
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
BOX_IMAGE = "ubuntu/xenial64"
import pika
import time
import sys
## Execute the script and then send a message (using the ui) to the queue called myqueue
class PyPikaTest:
def callback(self, ch, method, properties, body):
print("[Message Received] %s" % (body))
time.sleep(2.5 * 60)
Last Name First Name Email Address Password Org Unit Path Change Password at Next Sign-In
Bianchi Mario mario.bianchi@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima A TRUE
Rossi Rossella rossella.rossi@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima A TRUE
Verdi Silvia silvia.verdi@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima B TRUE
Gialli Ali ali.gialli@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima B TRUE
Neri Marco marco.neri@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima C TRUE
Marroni Anna anna.marroni@icxxxxx.istruzioneer.it password1 /Studenti/Studenti Elementari/Prima C TRUE
#!/bin/zsh
printf "%dGi/32Gi" $(cat /proc/meminfo | awk '{print $2}' | head -n 2 | tail -n 1)/1024/1024
@Gsantomaggio
Gsantomaggio / mandatory.md
Last active May 28, 2019 09:48
mandatory

Basic Idea

The idea is to add another parameter to the function RPCCLient as:

client = oslo_messaging.RPCClient(transport, target, options={'mandatory': True})
client.call({}, 'foo', id_value=str(i), test_value="hello oslo")

Inside the function, _publish decode the option value, as:

RabbitMQ test with different libraries

I made a few tests with different client libraries.

Environment:

  • Laptop 12 cores, 32 gb ram
  • Two rabbitmq nodes in cluster ( same machine)
  • RabbitMQ version 3.7.13 - Erlang 21.2.4
  • 64 async threads for each server
  • Ubuntu 18.04
#set -g default-terminal "rxvt-unicode-256color"
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi