http2amqp

command module
v0.0.0-...-af39fcd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 13 Imported by: 0

README

http2amqp

$ ./http2amqp -h
Usage of ./http2amqp:
  -httpPort="8080": The listen port for the https GET requests
  -uri="amqp://guest:guest@localhost:5672/TEST": Address for the amqp or rabbitmq server (including vhost)

Goals

Allows a stateless service (like a php page) to make fast queue inserts into an AMQP queue without the overhead of re-establishing the connection. This is written in the Go programming language (https://golang.org).

Supports auto-reconnect and re-synchronization of client and server.

##RabbitMQ installation For Mac:

brew install rabbitmq

Other OS, install from source: https://www.rabbitmq.com/releases/rabbitmq-server/v3.4.4/rabbitmq-server-mac-standalone-3.4.4.tar.gz

##Startup rabbitmq:

nohup rabbitmq-server &

##Define your message queue:

rabbitmqctl add_vhost TEST
rabbitmqctl set_permissions -p TEST guest ".*" ".*" ".*"
rabbitmqadmin declare queue --vhost=TEST name=AQUEUE durable=true

##Check your new message queue:

rabbitmqctl  list_vhosts
rabbitmqctl  list_permissions -p TEST
rabbitmqctl  list_bindings -p TEST
rabbitmqctl  list_queues -p TEST

##To test:

nohup ./http2amqp &
curl localhost:8080/AQUEUE/hello1
curl localhost:8080/AQUEUE/hello2
curl localhost:8080/AQUEUE/hello3

##Verify:

_tools/consumer/consumer
got Hello1
got hello2
got hello3

Documentation

Overview

Copyright (c) 2015 by Doug Watson. MIT permissive licence - Contact info at http://github.com/dougwatson/http2amqp

Directories

Path Synopsis
_tools

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL