You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/19 11:27:07 UTC
[GitHub] [pulsar] Jim-Lambert-Bose commented on issue #4302: Go client
blocks forever if tenant/namespace missing.
Jim-Lambert-Bose commented on issue #4302: Go client blocks forever if tenant/namespace missing.
URL: https://github.com/apache/pulsar/issues/4302#issuecomment-493748847
More information... It appears there's some sort of "environment issue". I've stripped my puslar code down to the example:
`
package main
import (
"context"
"fmt"
log "github.com/apache/pulsar/pulsar-client-go/logutil"
"github.com/apache/pulsar/pulsar-client-go/pulsar"
)
func Foo() {
fmt.Println("starting Foo...")
client, err := pulsar.NewClient(pulsar.ClientOptions{
URL: "pulsar://localhost:6650",
IOThreads: 5,
})
if err != nil {
log.Fatal(err)
}
defer client.Close()
fmt.Println("trying...")
producer, err := client.CreateProducer(pulsar.ProducerOptions{
Topic: "my-topic",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("created...")
defer producer.Close()
ctx := context.Background()
for i := 0; i < 10; i++ {
if err := producer.Send(ctx, pulsar.ProducerMessage{
Payload: []byte(fmt.Sprintf("hello-%d", i)),
}); err != nil {
log.Fatal(err)
}
}
`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services