Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from Financial-Times/aging-client
Browse files Browse the repository at this point in the history
Use the ageing client from gonsumer.
  • Loading branch information
David Smith committed Sep 19, 2016
2 parents 1f54e22 + 619b370 commit bf8f5fc
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions message_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ import (
func (bridge BridgeApp) consumeMessages() {
consumerConfig := bridge.consumerConfig

consumer := queueConsumer.NewConsumer(*consumerConfig, bridge.forwardMsg, http.Client{
Timeout: 60 * time.Second,
Transport: &http.Transport{
MaxIdleConnsPerHost: 100,
Dial: (&net.Dialer{
KeepAlive: 30 * time.Second,
}).Dial,
}})
consumer := queueConsumer.NewAgeingConsumer(*consumerConfig, bridge.forwardMsg, queueConsumer.AgeingClient{
Client: http.Client{
Timeout: 60 * time.Second,
Transport: &http.Transport{
MaxIdleConnsPerHost: 100,
Dial: (&net.Dialer{
KeepAlive: 30 * time.Second,
}).Dial,
},
},
MaxAge: time.Duration(2) * time.Minute,
})

var wg sync.WaitGroup
wg.Add(1)
Expand Down

0 comments on commit bf8f5fc

Please sign in to comment.