@ -33,37 +33,31 @@ go get github.com/wagslane/go-rabbitmq
Take note of the optional `options` parameters after the queue name. While not *necessary*, you'll *probably* want to at least declare the queue itself and some routing key bindings.
log.Printf("message returned from server: %s", string(r.Body))
}
}()
```
## Other usage examples
See the [examples](examples) directory for more ideas.
## Options and configuring
* By default, queues are created if they didn't already exist by new consumers
* By default, routing-key bindings are created by consumers if they didn't exist if you're using `WithConsumerOptionsRoutingKey`
* By default, exchanges are *not* created by publishers or consumers if they didn't already exist, hence `WithPublisherOptionsExchangeDeclare` and `WithConsumerOptionsExchangeDeclare`.
Read up on all the options in the GoDoc, there are quite a few of them. I try to pick sane and simple defaults.
## Closing and resources
Close your publishers and consumers when you're done with them and don't attempt to reuse them. Only close the connection itself once you've closed all associated publishers and consumers.
## Stability
Note that the API is currently in `v0`. I don't plan on any huge changes, but there may be some small breaking changes before we hit `v1`.
Note that the API is currently in `v0`. I don't plan on huge changes, but there may be some small breaking changes before we hit `v1`.