10 examples of 'rabbitmq routing key' in Go

Every line of 'rabbitmq routing key' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Go code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
139func (c *Call) RoutingKey() string {
140 if c == nil {
141 return ""
142 }
143 return c.ic.req.RoutingKey
144}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

122func (cb *ContextBuilder) SetRoutingKey(rk string) *ContextBuilder {
123 if cb.CallOptions == nil {
124 cb.CallOptions = new(CallOptions)
125 }
126 cb.CallOptions.RoutingKey = rk
127 return cb
128}
176func (binding TaskRunning) RoutingKey() string {
177 return generateRoutingKey(&binding)
178}
211func (q *AMQP) routingKey(metric telegraf.Metric) string {
212 if q.RoutingTag != "" {
213 key, ok := metric.GetTag(q.RoutingTag)
214 if ok {
215 return key
216 }
217 }
218 return q.RoutingKey
219}
526func (channel *Channel) ackMsg(unackedMessage *UnackedMessage, deliveryTag uint64) {
527 delete(channel.ackStore, deliveryTag)
528 q := channel.conn.GetVirtualHost().GetQueue(unackedMessage.queue)
529 if q != nil {
530 q.AckMsg(unackedMessage.msg)
531
532 channel.metrics.Acknowledge.Counter.Inc(1)
533 channel.metrics.Unacked.Counter.Dec(1)
534 }
535
536 channel.decQosAndConsumerNext(unackedMessage)
537}
92func rabbitmqReceive(r *Rabbitmq) {
93loop:
94 for {
95 deliveries, _ := r.sub.channel.Consume(
96 r.queue,
97 r.sub.tag,
98 false,
99 false,
100 false,
101 false,
102 nil,
103 )
104
105 for d := range deliveries {
106 if r.handler.ReceiveMessage(d.Body) {
107 break loop
108 }
109 }
110 }
111}
182func (ch *Channel) QueueUnbind(name, route, exchange string, _ wabbit.Option) error {
183 return ch.Channel.QueueUnbind(name, route, exchange, nil)
184}
10func checkBind(queue string, routingKey string) error {
11 if len(queue) == 0 {
12 return fmt.Errorf("queue empty forbidden")
13 } else if len(queue) > proto.MaxQueueName {
14 return fmt.Errorf("queue too long")
15 } else if len(routingKey) > proto.MaxRoutingKeyName {
16 return fmt.Errorf("routingkey too long")
17 }
18 return nil
19}
146func RabbitQueueConsumer(ch *amqp.Channel, config QueueConfig) <-chan amqp.Delivery {
147 msgs, err := ch.Consume(
148 config.Name,
149 config.Exchange,
150 config.AutoAck,
151 config.Exclusive,
152 config.Local,
153 config.Wait,
154 nil,
155 )
156
157 if err != nil {
158 panic(err.Error())
159 }
160
161 return msgs
162}
107func (c *AMQPMessageQueueProvider) BindKey() string {
108 bindKey := c.macro.Consume["key"]
109 if bindKey != "" {
110 return bindKey
111 }
112 return c.QueueName()
113}

Related snippets