Skip to content

Commit

Permalink
Pulsar 2.0 (#10)
Browse files Browse the repository at this point in the history
* Update protobuf files using `v2.0.1-incubating`
* Modifications to support latests api changes
* Modify CLI to allow producing from STDIN
  • Loading branch information
awilliams committed Jul 27, 2018
1 parent 1e3575b commit 6501730
Show file tree
Hide file tree
Showing 11 changed files with 1,067 additions and 329 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
.DS_Store

# Test binary, build with `go test -c`
*.test

Expand Down
23 changes: 6 additions & 17 deletions Makefile
Expand Up @@ -13,11 +13,6 @@

pulsarSrc := ${GOPATH}/src/github.com/apache/incubator-pulsar

protoPkgName := api
protoOutput := ${protoPkgName}/PulsarApi.pb.go
protoDefinitions := ${pulsarSrc}/pulsar-common/src/main/proto
protoTargets = $(wildcard ${protoDefinitions}/*.proto)

certDir := certs
certDirAbs := $(shell pwd)/${certDir}
certAppRole := app
Expand All @@ -30,32 +25,26 @@ certAdminRole := admin
# Requirements:
# * protoc and protoc-gen-go are installed. See: https://github.com/golang/protobuf
# * The Pulsar project checked out at $GOPATH/src/github.com/apache/incubator-pulsar
$(protoOutput): $(protoTargets)
@echo Generating $@ from definitions: $<
mkdir -p ${protoPkgName}
protoc --go_out=import_path=${protoPkgName}:${protoPkgName} --proto_path=${protoDefinitions} ${protoTargets}

api/PulsarApi.pb.go:
cd api && ./generate.bash ${pulsarSrc}

# When running the standalone server using TLS, the sample
# topics aren't created properly. This target performs the
# necessary admin commands to create the topic and permissions.
.PHONY: standalone-tls-ns
standalone-tls-ns:
${pulsarSrc}/bin/pulsar-admin \
--admin-url https://localhost:8081 \
properties create sample \
tenants create sample \
--admin-roles admin \
--allowed-clusters standalone
--allowed-clusters standalone || true
@sleep 1
${pulsarSrc}/bin/pulsar-admin \
--admin-url https://localhost:8081 \
namespaces create sample/standalone/ns1
namespaces create sample/standalone/ns1 || true
@sleep 1
${pulsarSrc}/bin/pulsar-admin \
--admin-url https://localhost:8081 \
namespaces grant-permission sample/standalone/ns1 \
--actions produce,consume \
--role ${certAppRole}
--role ${certAppRole} || true

.PHONY: pulsar-tls-conf
pulsar-tls-conf: pulsar-conf/client.tls.conf pulsar-conf/standalone.tls.conf
Expand Down
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -15,7 +15,7 @@ In comparison, this library is 100% Go (no cgo required). Outside the Go standar

**Status**

This client is a work-in-progress and as such does not support all Pulsar features. It supports `v1.22` of Pulsar.
This client is a work-in-progress and as such does not support all Pulsar features. It supports Pulsar 2.0 along with 1.22.

The following is an incomplete list of features that are not yet implemented:

Expand All @@ -24,7 +24,6 @@ The following is an incomplete list of features that are not yet implemented:
* Partitioned topics support
* Athenz authentication support
* Encryption support
* Pulsar `2.x` support

**Goals**

Expand Down

0 comments on commit 6501730

Please sign in to comment.