123456789101112131415161718192021222324252627 |
- package rabbitMQ
- import (
- "testing"
- )
- func TestNewProducter(t *testing.T) {
- exchange := Exchange{
- Name: "gt.dc.event",
- Type: "fanout", // 广播
- QueueName: "step_change",
- Key: "UF-4001A",
- Dns: "amqp://admin:devmq*1120@47.96.12.136:5672/",
- }
- got, err := NewProducter(exchange)
- t.Log(got, err)
- send := got.Publisher("EVENT:NOFITY:92:CEB_TRIGGER", []byte(`{"device_code":"UF_4001A"}`))
- t.Log(send)
- if got != nil {
- got.Close()
- }
- }
|