Skip to content

Commit

Permalink
removing Kafka from basket-api
Browse files Browse the repository at this point in the history
  • Loading branch information
jurabek committed Dec 27, 2023
1 parent 71f90fe commit 3e324ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/backend/services/basket-api/cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"syscall"
"time"

"github.com/Shopify/sarama"
"github.com/jurabek/basket.api/cmd/config"
"github.com/jurabek/basket.api/internal/database"
"github.com/jurabek/basket.api/internal/docs"
Expand All @@ -24,7 +23,6 @@ import (
"google.golang.org/grpc/reflection"

"github.com/redis/go-redis/extra/redisotel/v9"
"go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama"
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -90,13 +88,13 @@ func main() {
fmt.Print(err)
}

p, err := sarama.NewSyncProducer([]string{cfg.KafkaBroker}, nil)
if err != nil {
log.Fatal().Err(err).Msg("new producer failed!")
}
// p, err := sarama.NewSyncProducer([]string{cfg.KafkaBroker}, nil)
// if err != nil {
// log.Fatal().Err(err).Msg("new producer failed!")
// }

tracedProducer := otelsarama.WrapSyncProducer(nil, p)
defer tracedProducer.Close()
// tracedProducer := otelsarama.WrapSyncProducer(nil, p)
// defer tracedProducer.Close()

basketRepository := repositories.NewRedisBasketRepository(redisClient)
basketHandler := handlers.NewBasketHandler(basketRepository)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func NewBasketHandler(r GetCreateDeleter) *BasketHandler {
}

// Create go doc
//
// @Summary Add a CustomerBasket
// @Description add by json new CustomerBasket
// @Tags CustomerBasket
Expand Down Expand Up @@ -60,6 +61,7 @@ func (bc *BasketHandler) Create(c *gin.Context) {
}

// Get go doc
//
// @Summary Gets a CustomerBasket
// @Description Get CustomerBasket by ID
// @Tags CustomerBasket
Expand All @@ -83,6 +85,7 @@ func (bc *BasketHandler) Get(c *gin.Context) {
}

// Delete go doc
//
// @Summary Deletes a CustomerBasket
// @Description Deletes CustomerBasket by ID
// @Tags CustomerBasket
Expand Down

0 comments on commit 3e324ea

Please sign in to comment.