智慧食堂-队列消费项目
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

39 satır
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. FanOutQueueType = "FanOutQueue"
  9. )
  10. type MsgClient struct {
  11. Conn *amqp.Connection
  12. Type string `json:"type"` //消息类型
  13. Data string `json:"data"` //队列数据
  14. }
  15. type SimpleQueue struct {
  16. RoutKey string `json:"rout_key"` //路由
  17. Queue string `json:"queue"` //队列的名字
  18. IsPersistent bool `json:"is_persistent"` //队列是否持久化
  19. }
  20. type ComplexQueue struct {
  21. ExchangeName string `json:"exchangeName"`
  22. RoutKey string `json:"rout_key"` //路由
  23. Queue string `json:"queue"` //队列的名字
  24. IsPersistent bool `json:"is_persistent"` //队列是否持久化
  25. }
  26. type TopicQueue struct {
  27. ExchangeName string `json:"exchangeName"`
  28. RoutKey string `json:"rout_key"` //路由
  29. Queue string `json:"queue"` //队列的名字
  30. IsPersistent bool `json:"is_persistent"` //队列是否持久化
  31. BindKey string `json:"bind_key"` //绑定的路由
  32. }