Skip to content
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

Push to TCP not round robining #158

Open
zippy1981 opened this issue Dec 6, 2024 · 0 comments
Open

Push to TCP not round robining #158

zippy1981 opened this issue Dec 6, 2024 · 0 comments

Comments

@zippy1981
Copy link

I have the following code to write messages to zeromq from a writer

func ZQServerStart(endChannel chan bool) {
	// Create a new REP (Reply) socket
	server := zmq4.NewPull(context.Background())
	defer server.Close()
	endpoint := config.GetEndPoint()
	if err := server.Listen(endpoint); err != nil {
		log.Fatalf("Failed to bind server: %v", err)
	}
	fmt.Printf("Server listening on %s\n", endpoint)

	clean := <-endChannel

	fmt.Println("Server shutting down");
	if (!clean) {
		log.Fatalf("Server did not shut down cleanly")
	}
}

Then I have two other listeners (one written in node and python). They both receive all the messages. When I write a simple push app in python, the messages get round robined correctly.

func ZQServerStart(endChannel chan bool) {
	// Create a new REP (Reply) socket
	server := zmq4.NewPull(context.Background())
	defer server.Close()
	endpoint := config.GetEndPoint()
	if err := server.Listen(endpoint); err != nil {
		log.Fatalf("Failed to bind server: %v", err)
	}
	fmt.Printf("Server listening on %s\n", endpoint)

	clean := <-endChannel

	fmt.Println("Server shutting down");
	if (!clean) {
		log.Fatalf("Server did not shut down cleanly")
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant