-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go Change from github.com/Shopify/sarama to github.com/IBM/sarama #2652
Comments
This message shows that you appear to have updated the import path in your main module, but not in the github.com/exadevt/go-commont library that you're calling into |
The library github.com/exadevt/go-commont was updated. However there is a go module from "github.com/cloudevents" that's still has an "import github.com/Shopify/sarama". There is a fix mentioned here at : cloudevents/sdk-go@7f5ef39 What do I ned to do to implement that fix? |
Looks like they haven't cut a new release since making that change In the short term you can bump the dependency via |
Raised an upstream issue to query that cloudevents/sdk-go#938 |
Thank you for raising the issue. the go get ...@Head does not seem to work with my dockerfile config. |
Here is the result of the go get. go: downloading github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 |
Still failing on Shopify/sarama... |
Dockerfile:49 |
The error in #2652 (comment) still suggests that whilst you have `"github.com/IBM/sarama" in your go.mod file and/or in one of more of your source files, you must still have an import of the old path: import (
"github.com/Shopify/sarama"
) somewhere in you Go code in a file in the The error in #2652 (comment) I can't easily help you with as your code repos are private, but the |
@exadevt so adding a go.mod/go.sum with https://github.com/exadevt/go-commont/pull/1 allows the library module to build and tests to pass |
I couldn't find an import to Shopify/sarama to exadevt/go-commont/events. I made exadevt/go-comments/events public |
I have two modules: On Module1 import (
) import ( On which module should I run go get github.com/cloudevents/sdk-go/protocol/kafka_sarama/v2@HEAD? on hydrophone or from go-commont ? Hydrophone uses a Dockerfile to build a docker image. Module 2 does not use Dockerfile or docker. It's mainly a set a common librairies used by other modules such as hydrophone. |
Please find enclosed the go mod tidy for hydrophone. I noticed it contains some references to Shopify. Although hydrophone has no direct references to Shopify |
References to Shopify from hydrophone mod tidy go: downloading github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 |
I have made public exadevt/hydrophone, exadevt/clinic and exadevt/go-commont |
Repos seem to have been made private again, but the fix I shared with you is what you need basically — |
I followed the instructions, run the Dockerfile inside hydrophone (module 1 folder)
|
I've made the repo public... |
Inside the Dockerfile I ran the go get...@Head. It fails with the message I sent you before. |
Description
My go pacgae coded with Shopify/sarama is not working anymore. I followed the recommended change to replace github.com/Shopify/sarama by github.com/IBM/sarama and enned up with the following error when runnin go mod tidy.
/go/pkg/mod/github.com/exadevt/go-commont@v0.10.1/events/consumer.go:48:56: cannot use cm (variable of type *"github.com/IBM/sarama".ConsumerMessage) as *"github.com/Shopify/sarama".ConsumerMessage value in argument to kafka_sarama.NewMessageFromConsumerMessage
#0 58.51 /go/pkg/mod/github.com/exadevt/go-commont@v0.10.1/events/sender.go:44:61: cannot use config.SaramaConfig (variable of type *"github.com/IBM/sarama".Config) as *"github.com/Shopify/sarama".Config value in argument to kafka_sarama.NewSender
==================consumer.go
cm is a variable declared here in consumer.go
func (c *CloudEventsMessageConsumer) HandleKafkaMessage(cm *sarama.ConsumerMessage) error {
message := kafka_sarama.NewMessageFromConsumerMessage(cm)
if rs, rserr := binding.ToEvent(context.Background(), message); rserr == nil {
c.handleCloudEvent(*rs)
}
return nil
}
sender.go================================
func newKafkaCloudEventsProducerWithTopic(config *CloudEventsConfig, topic string) (*KafkaCloudEventsProducer, error) {
// We are using a sync producer which requires setting the variables below
config.SaramaConfig.Producer.Return.Errors = true
config.SaramaConfig.Producer.Return.Successes = true
}
Versions
github.com/Shopify/sarama v1.27.0
Configuration
Logs
logs: CLICK ME
Additional Context
The text was updated successfully, but these errors were encountered: