Skip to content

Commit

Permalink
fix: Kafka sensor url. Fixes #1006 (#1008)
Browse files Browse the repository at this point in the history
* use split function for kafka brokers url

Signed-off-by: Davide Berdin <[email protected]>

* add comment for kafka brokers url

Signed-off-by: Davide Berdin <[email protected]>

* add rtlnl in the USERS.md file

Signed-off-by: Davide Berdin <[email protected]>

* ran: make codegen

Signed-off-by: Davide Berdin <[email protected]>

* add back namespace-install.yaml

Signed-off-by: Davide Berdin <[email protected]>

* add new line in namespace-install.yaml file

Signed-off-by: Davide Berdin <[email protected]>

* missing line

Signed-off-by: Davide Berdin <[email protected]>

* Update namespace-install.yaml

remove extra space

Co-authored-by: Derek Wang <[email protected]>
  • Loading branch information
spaghettifunk and whynowy authored Jan 11, 2021
1 parent c29e947 commit 118856e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Organizations below are **officially** using Argo Events. Please send a PR with
1. [OneCause](https://www.onecause.com/)
1. [Rakuten](https://www.rakuten.com)
1. [Viaduct](https://www.viaduct.ai/)
1. [RTL Nederland](https://www.rtl.nl)
2 changes: 1 addition & 1 deletion api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/sensor.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/sensor.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/sensor/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/sensor/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/sensor/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ type AWSLambdaTrigger struct {

// KafkaTrigger refers to the specification of the Kafka trigger.
type KafkaTrigger struct {
// URL of the Kafka broker.
// URL of the Kafka broker, multiple URLs separated by comma.
URL string `json:"url" protobuf:"bytes,1,opt,name=url"`
// Name of the topic.
// More info at https://kafka.apache.org/documentation/#intro_topics
Expand Down
4 changes: 3 additions & 1 deletion sensors/triggers/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package kafka
import (
"context"
"encoding/json"
"strings"
"time"

"github.com/Shopify/sarama"
Expand Down Expand Up @@ -86,7 +87,8 @@ func NewKafkaTrigger(sensor *v1alpha1.Sensor, trigger *v1alpha1.Trigger, kafkaPr
}
config.Producer.RequiredAcks = ra

producer, err = sarama.NewAsyncProducer([]string{kafkatrigger.URL}, config)
urls := strings.Split(kafkatrigger.URL, ",")
producer, err = sarama.NewAsyncProducer(urls, config)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 118856e

Please sign in to comment.