golang 的 rabbitmq 消费项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.1 KiB

  1. package md
  2. import "github.com/streadway/amqp"
  3. const (
  4. SimpleQueueType = "SimpleQueue"
  5. BroadQueueType = "BroadQueue"
  6. DirectQueueType = "DirectQueue"
  7. TopicQueueType = "TopicQueue"
  8. )
  9. type MsgClient struct {
  10. Conn *amqp.Connection
  11. Type string `json:"type"` //消息类型
  12. Data string `json:"data"` //队列数据
  13. }
  14. type SimpleQueue struct {
  15. RoutKey string `json:"rout_key"` //路由
  16. Queue string `json:"queue"` //队列的名字
  17. IsPersistent bool `json:"is_persistent"` //队列是否持久化
  18. }
  19. type ComplexQueue struct {
  20. ExchangeName string `json:"exchangeName"`
  21. RoutKey string `json:"rout_key"` //路由
  22. Queue string `json:"queue"` //队列的名字
  23. IsPersistent bool `json:"is_persistent"` //队列是否持久化
  24. }
  25. type TopicQueue struct {
  26. ExchangeName string `json:"exchangeName"`
  27. RoutKey string `json:"rout_key"` //路由
  28. Queue string `json:"queue"` //队列的名字
  29. IsPersistent bool `json:"is_persistent"` //队列是否持久化
  30. BindKey string `json:"bind_key"` //绑定的路由
  31. }