Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMQP Consumer plugin #1678

Merged
merged 8 commits into from
Mar 3, 2017
Prev Previous commit
Next Next commit
make batch size configurable
  • Loading branch information
jackzampolin authored and danielnelson committed Mar 1, 2017
commit 863eea749eeeecaa03a5b9b9461e9a1ddc5e10ba
4 changes: 3 additions & 1 deletion plugins/inputs/amqp_consumer/amqp_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type AMQPConsumer struct {
AMQPHost string
AMQPPort string
Queue string
Prefetch int

sync.Mutex

Expand All @@ -43,6 +44,7 @@ func (rmq *AMQPConsumer) SampleConfig() string {
amqp_port = "5672"
# name of the queue to consume from
queue = "task_queue"
prefetch = 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing and what does this option do?


data_format = "influx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should put the standard comment in here that is in other plugins

`
Expand Down Expand Up @@ -84,7 +86,7 @@ func (rmq *AMQPConsumer) Start(acc telegraf.Accumulator) error {
rmq.q = q

// Declare QoS on queue
err = ch.Qos(1, 0, false)
err = ch.Qos(rmq.Prefetch, 0, false)
if err != nil {
return fmt.Errorf("%v: failed to set Qos", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be QoS in error message.

}
Expand Down