Coder Social home page Coder Social logo

Comments (10)

qrpike avatar qrpike commented on August 21, 2024 2

@edenhill #115 turned out to be my issue. Working fine now.

from confluent-kafka-go.

edenhill avatar edenhill commented on August 21, 2024

Do both topics exist in the cluster?

from confluent-kafka-go.

felipejfc avatar felipejfc commented on August 21, 2024

yes, they do, I've also tested it and reproduced locally...

from confluent-kafka-go.

felipejfc avatar felipejfc commented on August 21, 2024

@edenhill I've tested now using a regex and it works (only 1 topic passed to SubscribeTopics containing a regex that matches two topics) but still, sending two topics in a slice makes it only subscribe to the last one

from confluent-kafka-go.

edenhill avatar edenhill commented on August 21, 2024

I can't reproduce this:

$ ./consumer_example :9093 g1 xtest1 xtest2 xtest3
Created Consumer rdkafka#consumer-1
% Message on xtest1[0]@0:
msg1
% Reached EOF at xtest1[0]@1(Broker: No more messages)
% Message on xtest2[0]@0:
msg2
% Message on xtest3[0]@0:
msg3
% Reached EOF at xtest2[0]@1(Broker: No more messages)
% Reached EOF at xtest3[0]@1(Broker: No more messages)
Ignored OffsetsCommitted (<nil>, [xtest1[0]@1 xtest2[0]@1 xtest3[0]@1])

Is your q.assignPartitions() loosing the extra topics perhaps?

from confluent-kafka-go.

edenhill avatar edenhill commented on August 21, 2024

Can you print q.Topics prior to calling SubscribeTopics?

from confluent-kafka-go.

felipejfc avatar felipejfc commented on August 21, 2024

@edenhill is it possible that my assignPartitions is overwriting assignments?

func (q *KafkaConsumer) assignPartitions(partitions []kafka.TopicPartition) error {
	l := q.Logger.WithFields(logrus.Fields{
		"method":     "assignPartitions",
		"partitions": fmt.Sprintf("%v", partitions),
	})

	l.Debug("Assigning partitions...")
	err := q.Consumer.Assign(partitions)
	if err != nil {
		l.WithError(err).Error("Failed to assign partitions.")
		return err
	}
	l.Info("Partitions assigned.")
	return nil
}

full code is here

https://github.com/topfreegames/pusher/blob/master/extensions/kafka_consumer.go

if you do not find something that may be causing this, I will investigate it further, for now I got it to work using regex anyway, so this is not critic for me anymore, but I'm willing to help if you need

from confluent-kafka-go.

edenhill avatar edenhill commented on August 21, 2024

The code looks fine, can't see anything obvious.
Could you add some debugging and see where the topic lists gets lost?

from confluent-kafka-go.

qrpike avatar qrpike commented on August 21, 2024

Did anyone solve this issue?

Thanks,

from confluent-kafka-go.

edenhill avatar edenhill commented on August 21, 2024

@qrpike What is the exact issue you are seeing? And do you have some code to show?

from confluent-kafka-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.