Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 1.01 KB

README.md

File metadata and controls

27 lines (21 loc) · 1.01 KB

##AMQP

Builtin supports using AMQP as both brokers and backends, we implement NamedBroker and Backend in this component:

import dgamqp // package name is prefixed 'dg' to avoid confliction with "amqp" package

brk, err := dgamqp.NewBroker(nil)  // create a Redis-Broker with default configuration
bkd, err := dgamqp.NewBackend(nil) // create a Redis-Backend with default configuration

Internally, a rabbitmq server would be installer for testing.

There is nothing much to config so far. More option would be added as needed.

import dgamqp

config := dgamqp.DefaultAmqpConfig()
cfg.Host("127.0.0.1") // host address
  .Port(123) // host port
  .User("user123") // user name
  .Password("pwd123") // password
  .MaxChannel(128) // maximum channels preallocated

// create with new configuration
brk, err := dgamqp.NewBroker(cfg)
bkd, err := dgamqp.NewBackend(cfg)