Skip to content

Commit

Permalink
make batch size configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin committed Oct 7, 2016
1 parent 9a44096 commit 79f071b
Showing 1 changed file with 3 additions and 1 deletion.
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
data_format = "influx"
`
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)
}
Expand Down

0 comments on commit 79f071b

Please sign in to comment.