MCPcopy Create free account
hub / github.com/ebosas/microservices / PublishInChannel

Function PublishInChannel

internal/rabbit/publish.go:17–30  ·  view source on GitHub ↗

PublishInChannel publishes a message to a Rabbit exchange using a provided channel. For use in go routines.

(ch *amqp.Channel, exch, rKey string, message []byte)

Source from the content-addressed store, hash-verified

15// PublishInChannel publishes a message to a Rabbit exchange using
16// a provided channel. For use in go routines.
17func PublishInChannel(ch *amqp.Channel, exch, rKey string, message []byte) error {
18 return ch.Publish(
19 exch, // exchane name
20 rKey, // routing key
21 false, // mandatory
22 false, // immediate
23 amqp.Publishing{
24 ContentType: "application/json",
25 DeliveryMode: amqp.Persistent,
26 Timestamp: time.Now(),
27 Body: message,
28 },
29 )
30}

Callers 2

handlePublishRabbitFunction · 0.92
PublishMethod · 0.85

Calls 1

PublishMethod · 0.80

Tested by

no test coverage detected