http-proxy-amqp

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

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

Go to latest
Published: Aug 24, 2017 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

http-proxy-amqp

Go Report

[Intro]

This is an amqp connection pool implementation.

It provides HTTP APIs to access MQ (eg, rabbitmq) And maintains a long connection to MQ to improve performance.

Alt text

[Install]

go version: go1.8.1+

$ go get github.com/iyidan/http-proxy-amqp

$ http-proxy-amqp -h
Usage of http-proxy-amqp:
  -config string
    	The config file
  -debug
    	if true, will print pool stats per requests
  -dsn string
    	The amqp address
  -httpListenAddr string
    	http api listen address
  -maxChannelsPerConnection int
    	The max channels per connection
  -maxConnections int
    	The max connections for this process
  -maxIdleChannels int
    	The max idle channels for this process
  -minConnections int
    	The min connections keeped for this process

[Start]

It is recommended to use supervisord to start

./http-proxy-amqp -config=path_to_config_file.json

path_to_config_file.json

{
    // DSN is the amqp address
    // The format is amqp://user:password@host:port/vhost
    // such as amqp://iyidan:123456@127.0.0.1:5672//aaa (the created vhost is /aaa not aaa)
    // Notice: user/password must be urlencoded if necessary
    // Notice: vhost maybe have a leading slash
    "dsn":"",

    "maxChannelsPerConnection":20000,
    "maxIdleChannels":500,
    "maxConnections":2000,
    "minConnections":5,

    // http api address
    "httpListenAddr":"127.0.0.1:35673"
}

[APIs]

  • POST /confirm_send?exchange=$exchange&routingKey=$routingKey

    send a persistent message with confirm mode

    The Response is OK if success

[Example]

curl -XPOST 'http://127.0.0.1:35673/confirm_send?exchange={xx}&routingKey={xx}' -d 'msg'
OK

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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