Skip to content

Commit

Permalink
iconsume and consumer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Dec 18, 2023
1 parent a1e4031 commit 3e3c91c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/event_listener/consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ type Consumer struct {

type JsonHandler func(value []byte)

func NewConsumer(config *config.KafkaConfiguration, overrideConsumer IConsume) (*Consumer, error) {
c := overrideConsumer
func NewConsumer(config *config.KafkaConfiguration, overrideKafkaConsumer IConsume) (*Consumer, error) {
c := overrideKafkaConsumer
var err error
if overrideConsumer == nil {
if overrideKafkaConsumer == nil {
c, err = kafka.NewConsumer(&kafka.ConfigMap{
"bootstrap.servers": config.Brokers,
"client.id": "port-k8s-exporter",
Expand Down
2 changes: 1 addition & 1 deletion pkg/event_listener/event_listener_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func startKafkaEventListener(l *EventListener, resync func()) error {
}

topic := orgId + ".change.log"
instance, err := consumer.NewConsumer(c)
instance, err := consumer.NewConsumer(c, nil)

if err != nil {
return err
Expand Down

0 comments on commit 3e3c91c

Please sign in to comment.