commit | 2c5503b39b39d5e6b5e5cfdcef27c24ba143861b | [log] [tgz] |
---|---|---|
author | Jia Zhai <zhaijia@apache.org> | Fri Jul 26 10:41:02 2019 +0800 |
committer | GitHub <noreply@github.com> | Fri Jul 26 10:41:02 2019 +0800 |
tree | 5959f37215e67733be8618b1dd8fb13130b5d3ca | |
parent | c53f30d1a177db49f89ee5fa2cc8b04f3ce7354e [diff] | |
parent | aec466dd129b13e47e11324169ed37f382181ecd [diff] |
Merge pull request #24 from wolfstudy/xiaolong/code_format_producer [issue:23]Use golangci-lint to format the code for the master branch run golangci-lint and format the code for the master branch.
Note: this library is still a work in progress. For production usage, please refer to the CGo based client library, documented at http://pulsar.apache.org/docs/en/client-libraries-go/
This projects is developing a pure-Go client library for Pulsar that does not depend on the C++ Pulsar library.
Once feature parity and stability are reached, this will supersede the current CGo based library.
Check the Projects page at https://github.com/apache/pulsar-client-go/projects for tracking the status and the progress.
Import the client library:
import "github.com/apache/pulsar-client-go/pulsar"
client, err := pulsar.NewClient(pulsar.ClientOptions{
URL: "pulsar://localhost:6650",
})
producer, err := client.CreateProducer(pulsar.ProducerOptions{
Topic: "my-topic",
})
err = producer.Send(context.Background(), &pulsar.ProducerMessage{
Payload: []byte("hello"),
})
if err == nil {
fmt.Println("Published message")
} else {
fmt.Println("Failed to publish message", err)
}
Name | Scope | |||
---|---|---|---|---|
users@pulsar.apache.org | User-related discussions | Subscribe | Unsubscribe | Archives |
dev@pulsar.apache.org | Development-related discussions | Subscribe | Unsubscribe | Archives |
Pulsar slack channel #dev-go
at https://apache-pulsar.slack.com/
You can self-register at https://apache-pulsar.herokuapp.com/
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0