Skip to content

Commit

Permalink
fixes router
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhang Balkundi committed Mar 27, 2024
1 parent f9af7af commit 1c34b9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v2.0.14] 2024-03-25
## [v2.0.15] 2024-03-25

# Removed

Expand Down
2 changes: 1 addition & 1 deletion cmd/ziggurat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
die(errors.New(usage))
}
appName := args[1]
d := Data{AppName: appName, Version: "v2.0.14"}
d := Data{AppName: appName, Version: "v2.0.15"}
wd, err := os.Getwd()
die(err)

Expand Down
12 changes: 6 additions & 6 deletions example/sampleapp/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//go:build ignore

package main

import (
"context"
"fmt"

"github.com/gojekfarm/ziggurat/v2"
"github.com/gojekfarm/ziggurat/v2/kafka"
"github.com/gojekfarm/ziggurat/v2/logger"
Expand All @@ -16,23 +17,22 @@ func main() {
l := logger.NewLogger(logger.LevelInfo)

kcg := kafka.ConsumerGroup{
Logger: l,
Logger: logger.NewLogger(logger.LevelInfo),
GroupConfig: kafka.ConsumerConfig{
BootstrapServers: "g-gojek-id-mainstream.golabs.io:6668",
GroupID: "bar.id",
GroupID: "foo.id",
ConsumerCount: 1,
AutoOffsetReset: "earliest",
Topics: []string{"^.*-booking-log"},
},
}

router := ziggurat.NewRouter()
router.HandlerFunc("bar.id/.*", func(ctx context.Context, event *ziggurat.Event) {
router.HandlerFunc("foo.id/gofood-.*", func(ctx context.Context, event *ziggurat.Event) {
fmt.Println("path:", event.RoutingPath)
})

if runErr := zig.Run(ctx, router, &kcg); runErr != nil {
l.Error("error running streams", runErr)
l.Error("error running consumers", runErr)
}

}

0 comments on commit 1c34b9d

Please sign in to comment.