-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamqpx.go
42 lines (34 loc) · 1.22 KB
/
amqpx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Package amqpx provides working with RabbitMQ using AMQP 0.9.1.
package amqpx
import (
"fmt"
"github.com/rabbitmq/amqp091-go"
)
var (
errChannelClosed = fmt.Errorf("channel/connection is not open")
errPublishConfirm = fmt.Errorf("publish has not confirmation")
errUnmarshalerNotFound = fmt.Errorf("unmarshaler not found")
errMarshalerNotFound = fmt.Errorf("marshaler not found")
errRoutingKeyEmpty = fmt.Errorf("routing-key is empty")
errConnClosed = fmt.Errorf("connection closed")
errFuncNil = fmt.Errorf("consumer func nil")
)
// The delivery mode of messages is unrelated to the durability of the queues they reside on.
const (
// Transient means higher throughput but messages will not be restored on broker restart.
// Transient messages will not be restored to durable queues.
Transient = amqp091.Transient
// Persistent messages will be restored to
// durable queues and lost on non-durable queues during server restart.
Persistent = amqp091.Persistent
)
type Table = amqp091.Table
// Default exchanges.
const (
ExchangeDefault = ""
ExchangeDirect = "amq.direct"
ExchangeFanout = "amq.fanout"
ExchangeHeaders = "amq.headers"
ExchangeMatch = "amq.match"
ExchangeTopic = "amq.topic"
)