Skip to content

Commit 8aa2e03

Browse files
PGarulePGarule
authored andcommitted
Merge branch 'master' of https://github.com/apache/pulsar-client-go into producer-issue
2 parents e705ca9 + 1e37f2f commit 8aa2e03

62 files changed

Lines changed: 3704 additions & 930 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
go-version: [1.13, 1.14, 1.15, 1.16, 1.17]
9+
go-version: [1.15, 1.16, 1.17]
1010
steps:
1111
- name: clean docker cache
1212
run: |

.github/workflows/project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
go-version: [1.13, 1.14, 1.15, 1.16, 1.17]
9+
go-version: [1.15, 1.16, 1.17]
1010
steps:
1111
- name: Set up Go
1212
uses: actions/setup-go@v1

CHANGELOG.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,87 @@
2323

2424
All notable changes to this project will be documented in this file.
2525

26+
[0.8.1] 2022-03-08
27+
28+
## What's Changed
29+
* Upgrade beefsack/go-rate by @shubham1172 in https://github.com/apache/pulsar-client-go/pull/735
30+
* Upgrade prometheus client to 1.11.1 by @nicoloboschi in https://github.com/apache/pulsar-client-go/pull/738
31+
32+
## New Contributors
33+
@shubham1172 made their first contribution in https://github.com/apache/pulsar-client-go/pull/735
34+
@nicoloboschi made their first contribution in https://github.com/apache/pulsar-client-go/pull/738
35+
36+
[0.8.0] 2022-02-16
37+
38+
## What's Changed
39+
* Update release docs with missing information by @cckellogg in https://github.com/apache/pulsar-client-go/pull/656
40+
* Update change log for 0.7.0 release by @cckellogg in https://github.com/apache/pulsar-client-go/pull/655
41+
* Update version to 0.7.0 by @cckellogg in https://github.com/apache/pulsar-client-go/pull/654
42+
* fix issue 650,different handle sequence value by @baomingyu in https://github.com/apache/pulsar-client-go/pull/651
43+
* Support nack backoff policy for SDK by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/660
44+
* Remove unused dependency in `oauth2` module by @reugn in https://github.com/apache/pulsar-client-go/pull/661
45+
* [Issue 662] Fix race in connection.go waitUntilReady() by @bschofield in https://github.com/apache/pulsar-client-go/pull/663
46+
* Update dependencies by @reugn in https://github.com/apache/pulsar-client-go/pull/665
47+
* [Issue 652] Quick fixes to the documentation for the main building blocks of the library by @reugn in https://github.com/apache/pulsar-client-go/pull/667
48+
* Add subscription properties for ConsumerOptions by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/671
49+
* Add new bug-resistant build constraints by @reugn in https://github.com/apache/pulsar-client-go/pull/670
50+
* Handle the parameters parsing error in NewProvider by @reugn in https://github.com/apache/pulsar-client-go/pull/673
51+
* Update email template of release docs by @izumo27 in https://github.com/apache/pulsar-client-go/pull/674
52+
* Add properties filed for batch container by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/683
53+
* [Issue 513] Correct apparent logic error in batchContainer's hasSpace() method by @bschofield in https://github.com/apache/pulsar-client-go/pull/678
54+
* Upgrade DataDog/zstd to v1.5.0 by @dferstay in https://github.com/apache/pulsar-client-go/pull/690
55+
* fix:add order key to message by @leizhiyuan in https://github.com/apache/pulsar-client-go/pull/688
56+
* Set default go version to 1.13 in CI related files by @reugn in https://github.com/apache/pulsar-client-go/pull/692
57+
* [Partition Consumer] Provide lock-free access to compression providers by @dferstay in https://github.com/apache/pulsar-client-go/pull/689
58+
* Use a separate gorutine to handle the logic of reconnect by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/691
59+
* [DefaultRouter] add a parallel bench test by @dferstay in https://github.com/apache/pulsar-client-go/pull/693
60+
* Revert "Use a separate gorutine to handle the logic of reconnect" by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/700
61+
* Fix data race while accessing connection in partitionProducer by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/701
62+
* Fix stuck when reconnect broker by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/703
63+
* Fix slice bounds out of range for readSingleMessage by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/709
64+
* Encryption failure test case fix by @GPrabhudas in https://github.com/apache/pulsar-client-go/pull/708
65+
* [DefaultRouter] fix unnecessary system clock reads due to races accessing router state by @dferstay in https://github.com/apache/pulsar-client-go/pull/694
66+
* Fix negative WaitGroup counter issue by @wolfstudy in https://github.com/apache/pulsar-client-go/pull/712
67+
* [issue 675] oauth2 use golang-jwt address CVE-2020-26160 by @zzzming in https://github.com/apache/pulsar-client-go/pull/713
68+
* readme: add note about how to build and test by @pgier in https://github.com/apache/pulsar-client-go/pull/714
69+
* Bump oauth2 package version to the latest in master by @iorvd in https://github.com/apache/pulsar-client-go/pull/715
70+
* Fix closed connection leak by @billowqiu in https://github.com/apache/pulsar-client-go/pull/716
71+
* [Bugfix] producer runEventsLoop for reconnect early exit by @billowqiu in https://github.com/apache/pulsar-client-go/pull/721
72+
* [issue 679][oauth2] Fix macos compiler warnings by @pgier in https://github.com/apache/pulsar-client-go/pull/719
73+
* [optimize] Stop batchFlushTicker when Disable batching by @Shoothzj in https://github.com/apache/pulsar-client-go/pull/720
74+
* Markdown error fix by @Shoothzj in https://github.com/apache/pulsar-client-go/pull/722
75+
76+
## New Contributors
77+
* @bschofield made their first contribution in https://github.com/apache/pulsar-client-go/pull/663
78+
* @izumo27 made their first contribution in https://github.com/apache/pulsar-client-go/pull/674
79+
* @pgier made their first contribution in https://github.com/apache/pulsar-client-go/pull/714
80+
* @iorvd made their first contribution in https://github.com/apache/pulsar-client-go/pull/715
81+
* @billowqiu made their first contribution in https://github.com/apache/pulsar-client-go/pull/716
82+
83+
[0.7.0] 2021-10-31
84+
85+
## Feature
86+
* Encryption support for producer, see [PR-560](https://github.com/apache/pulsar-client-go/pull/560)
87+
* Decrytion support for consumer, see [PR-612](https://github.com/apache/pulsar-client-go/pull/612)
88+
* User-defined metric cardinality, see [PR-604](https://github.com/apache/pulsar-client-go/pull/604)
89+
* Better support for Azure AD OAuth 2.0, see [PR-630](https://github.com/apache/pulsar-client-go/pull/630), [PR-633](https://github.com/apache/pulsar-client-go/pull/633), [PR-634](https://github.com/apache/pulsar-client-go/pull/634)
90+
* Removed testing for go versions 1.11 and 1.12, see [PR-632](https://github.com/apache/pulsar-client-go/pull/632)
91+
* Add epoch to create producer to prevent a duplicate producer when broker is not available., see [PR-582] (https://github.com/apache/pulsar-client-go/pull/582)
92+
93+
## Improve
94+
* Fix batch size limit validation, see [PR-528](https://github.com/apache/pulsar-client-go/pull/528)
95+
* Fix logic of command for sendError, see [PR-622](https://github.com/apache/pulsar-client-go/pull/622)
96+
* Drain connection requests channel without closing, see [PR-645](https://github.com/apache/pulsar-client-go/pull/645)
97+
* Fix ConsumersOpened counter not incremented when use multitopic or regexp consumer, see [PR-619](https://github.com/apache/pulsar-client-go/pull/619)
98+
* Fix reconnection logic when topic is deleted, see [PR-627](https://github.com/apache/pulsar-client-go/pull/627)
99+
* Fix panic when scale down partitions, see [PR-601](https://github.com/apache/pulsar-client-go/pull/601)
100+
* Fix missing metrics for topics by registration of existing collector, see [PR-600](https://github.com/apache/pulsar-client-go/pull/600)
101+
* Fix producer panic by oldProducers, see [PR-598](https://github.com/apache/pulsar-client-go/pull/598)
102+
* Fail pending messages when topic is terminated, see [PR-588](https://github.com/apache/pulsar-client-go/pull/588)
103+
* Fix handle send error panic, see [PR-576](https://github.com/apache/pulsar-client-go/pull/576)
104+
105+
106+
26107
[0.6.0] 2021-07-21
27108

28109
## Feature

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# under the License.
1818
#
1919

20-
ARG GO_VERSION=golang:1.12
21-
FROM apachepulsar/pulsar:latest as pulsar
20+
ARG GO_VERSION=golang:1.15
21+
FROM apachepulsar/pulsar:2.8.2 as pulsar
2222
FROM $GO_VERSION as go
2323

2424
RUN apt-get update && apt-get install -y openjdk-11-jre-headless ca-certificates

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CGo based library.
3636

3737
## Requirements
3838

39-
- Go 1.11+
39+
- Go 1.15+
4040

4141
## Status
4242

@@ -72,8 +72,9 @@ defer producer.Close()
7272

7373
if err != nil {
7474
fmt.Println("Failed to publish message", err)
75+
} else {
76+
fmt.Println("Published message")
7577
}
76-
fmt.Println("Published message")
7778
```
7879

7980
Create a Consumer:
@@ -133,6 +134,16 @@ for reader.HasNext() {
133134
}
134135
```
135136

137+
## Build and Test
138+
139+
Build the sources:
140+
141+
go build ./pulsar
142+
143+
Run the unit tests:
144+
145+
./docker-ci.sh
146+
136147
## Contributing
137148

138149
Contributions are welcomed and greatly appreciated. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.
@@ -141,8 +152,8 @@ Contributions are welcomed and greatly appreciated. See [CONTRIBUTING.md](CONTRI
141152

142153
##### Mailing lists
143154

144-
| Name | Scope | | | |
145-
|:------------------------------------------------------------------------------|:--------------------------------|:----------------------------------------------------------------|:--------------------------------------------------------------------|:-----------------------------------------------------------------------------|
155+
| Name | Scope | | | |
156+
|:----------------------------------------------------------|:--------------------------------|:------------------------------------------------------|:----------------------------------------------------------|:-------------------------------------------------------------------|
146157
| [users@pulsar.apache.org](mailto:users@pulsar.apache.org) | User-related discussions | [Subscribe](mailto:users-subscribe@pulsar.apache.org) | [Unsubscribe](mailto:users-unsubscribe@pulsar.apache.org) | [Archives](http://mail-archives.apache.org/mod_mbox/pulsar-users/) |
147158
| [dev@pulsar.apache.org](mailto:dev@pulsar.apache.org) | Development-related discussions | [Subscribe](mailto:dev-subscribe@pulsar.apache.org) | [Unsubscribe](mailto:dev-unsubscribe@pulsar.apache.org) | [Archives](http://mail-archives.apache.org/mod_mbox/pulsar-dev/) |
148159

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This version number refers to the currently released version number
22
// Please fix the version when release.
3-
v0.6.0
3+
v0.8.0

docker-ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cd ${SRC_DIR}
2525

2626
IMAGE_NAME=pulsar-client-go-test:latest
2727

28-
GO_VERSION=${1:-1.12}
28+
GO_VERSION=${1:-1.16}
2929
docker rmi --force ${IMAGE_NAME} || true
3030
docker rmi --force apachepulsar/pulsar:latest || true
3131
docker build -t ${IMAGE_NAME} --build-arg GO_VERSION="golang:${GO_VERSION}" .

docs/release-process.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ In general, you need to perform the following steps:
1212
8. Update the release note.
1313
9. Announce the release.
1414

15+
### Requirements
16+
- [GPG keys to sign release artifacts](https://github.com/apache/pulsar/wiki/Create-GPG-keys-to-sign-release-artifacts)
17+
1518
## Steps in detail
1619

1720
1. Create a release branch.
@@ -65,9 +68,20 @@ $ gpg -b --armor apache-pulsar-client-go-0.X.0-src.tar.gz
6568
$ shasum -a 512 apache-pulsar-client-go-0.X.0-src.tar.gz > apache-pulsar-client-go-0.X.0-src.tar.gz.sha512
6669
```
6770

71+
Checkout repo for uploading artifacts
72+
```
73+
$ svn co https://dist.apache.org/repos/dist/dev/pulsar pulsar-dist-dev
74+
$ cd pulsar-dist-dev
6875
```
69-
$ mkdir pulsar-client-go-0.X.0-candidate-1
76+
77+
Create a candidate directory at the root repo
78+
```
79+
$ svn mkdir pulsar-client-go-0.X.0-candidate-1
7080
$ cd pulsar-client-go-0.X.0-candidate-1
81+
```
82+
83+
Copy the signed artifacts into the candiate directory and commit
84+
```
7185
$ cp ../apache-pulsar-client-go-0.X.0-* .
7286
$ svn add *
7387
$ svn ci -m 'Staging artifacts and signature for Pulsar Client Go release 0.X.0-candidate-1'
@@ -100,7 +114,7 @@ It fixes the following issues:
100114
https://github.com/apache/pulsar-client-go/milestone/1?closed=1
101115
102116
Pulsar Client Go's KEYS file contains PGP keys we used to sign this release:
103-
https://dist.apache.org/repos/dist/release/pulsar/KEYS
117+
https://dist.apache.org/repos/dist/dev/pulsar/KEYS
104118
105119
Please download these packages and review this release candidate:
106120
- Review release notes
@@ -110,7 +124,7 @@ README.md to build and run the pulsar-client-go.
110124
The vote will be open for at least 72 hours. It is adopted by majority approval, with at least 3 PMC affirmative votes.
111125
112126
Source file:
113-
https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-go/apache-pulsar-client-go-0.X.0-src.tar.gz
127+
https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-go-0.X.0-candidate-1/
114128
115129
The tag to be voted upon:
116130
v0.X.0
@@ -142,8 +156,9 @@ Remove the old releases (if any). We only need the latest release there, older r
142156
```
143157

144158
# Get the list of releases
145-
146-
svn ls https://dist.apache.org/repos/dist/release/pulsar/pulsar-client-go/
159+
```
160+
svn ls https://dist.apache.org/repos/dist/release/pulsar | grep client-go
161+
```
147162

148163
# Delete each release (except for the last one)
149164

go.mod

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
module github.com/apache/pulsar-client-go
22

3-
go 1.13
3+
go 1.15
44

55
require (
6-
github.com/AthenZ/athenz v1.10.15
7-
github.com/DataDog/zstd v1.4.6-0.20210211175136-c6db21d202f4
8-
github.com/apache/pulsar-client-go/oauth2 v0.0.0-20201120111947-b8bd55bc02bd
9-
github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6
6+
github.com/AthenZ/athenz v1.10.39
7+
github.com/DataDog/zstd v1.5.0
8+
github.com/apache/pulsar-client-go/oauth2 v0.0.0-20220120090717-25e59572242e
9+
github.com/beefsack/go-rate v0.0.0-20220214233405-116f4ca011a0
1010
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b
1111
github.com/davecgh/go-spew v1.1.1
1212
github.com/gogo/protobuf v1.3.2
13-
github.com/golang/protobuf v1.4.2
13+
github.com/golang/protobuf v1.5.2
1414
github.com/google/uuid v1.1.2
15-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
16-
github.com/klauspost/compress v1.10.8
15+
github.com/klauspost/compress v1.14.4
1716
github.com/linkedin/goavro/v2 v2.9.8
18-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
19-
github.com/modern-go/reflect2 v1.0.1 // indirect
2017
github.com/opentracing/opentracing-go v1.2.0
2118
github.com/pierrec/lz4 v2.0.5+incompatible
2219
github.com/pkg/errors v0.9.1
23-
github.com/prometheus/client_golang v1.7.1
24-
github.com/sirupsen/logrus v1.4.2
20+
github.com/prometheus/client_golang v1.11.1
21+
github.com/sirupsen/logrus v1.6.0
2522
github.com/spaolacci/murmur3 v1.1.0
26-
github.com/spf13/cobra v0.0.3
27-
github.com/spf13/pflag v1.0.3 // indirect
28-
github.com/stretchr/testify v1.5.1
23+
github.com/spf13/cobra v1.2.1
24+
github.com/stretchr/testify v1.7.0
2925
go.uber.org/atomic v1.7.0
30-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
26+
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
3127
)
3228

3329
replace github.com/apache/pulsar-client-go/oauth2 => ./oauth2

0 commit comments

Comments
 (0)