Skip to content

Enabling Pub/Sub to send and receive from multiple topics and subscriptions.#171

Merged
markpeek merged 7 commits into
cloudevents:masterfrom
n3wscott:multi-pubsub
Aug 19, 2019
Merged

Enabling Pub/Sub to send and receive from multiple topics and subscriptions.#171
markpeek merged 7 commits into
cloudevents:masterfrom
n3wscott:multi-pubsub

Conversation

@n3wscott
Copy link
Copy Markdown
Member

@n3wscott n3wscott commented Aug 11, 2019

In Knative, we need to be able to reuse a single CloudEvents client to listen to several subscriptions to allow the infrastructure to be cheaper and multi-tenant for a Google Cloud single secret.

This work enables a client to be configured with n Subscriptions and StartReceiver starts n go threads, and then blocks until the parent context has been canceled, canceling the threads and collecting the errors.

This change also enables a topic to be injected into the context of client.Send, redirecting the client to publish on that topic. This will allow a single client to target many topics and the transport deals with managing the topic instances.

Creation applies to the entire client.

Deletion are supported inside the connection object but it has not been wired up into an easy way to use it. This is a less (if at all) used feature and will be enabled in the future.

Scott Nichols added 3 commits August 9, 2019 21:01
Signed-off-by: Scott Nichols <nicholss@google.com>
Signed-off-by: Scott Nichols <nicholss@google.com>
Signed-off-by: Scott Nichols <nicholss@google.com>
Signed-off-by: Scott Nichols <nicholss@google.com>
@n3wscott n3wscott marked this pull request as ready for review August 12, 2019 15:34
Signed-off-by: Scott Nichols <nicholss@google.com>
Copy link
Copy Markdown
Contributor

@markpeek markpeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good but some changes suggested/requested. Also, are there any aliases you might want to add to alias.go as well?

Comment thread cmd/samples/pubsub/multireceiver/main.go Outdated
Comment thread cmd/samples/pubsub/multisender/main.go Outdated
Comment thread cmd/samples/pubsub/multisender/main.go Outdated
Comment thread cmd/samples/pubsub/receiver/main.go Outdated
Comment thread pkg/cloudevents/transport/pubsub/internal/conneciton.go
Scott Nichols added 2 commits August 19, 2019 14:23
Signed-off-by: Scott Nichols <nicholss@google.com>
Signed-off-by: Scott Nichols <nicholss@google.com>
Copy link
Copy Markdown
Contributor

@markpeek markpeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Thanks!

@markpeek markpeek merged commit 54b73fe into cloudevents:master Aug 19, 2019
n3wscott added a commit to n3wscott/sdk-go that referenced this pull request Sep 20, 2019
…ptions. (cloudevents#171)

Signed-off-by: Scott Nichols <nicholss@google.com>
n3wscott added a commit to n3wscott/sdk-go that referenced this pull request Sep 20, 2019
…ptions. (cloudevents#171)

Signed-off-by: Scott Nichols <nicholss@google.com>
n3wscott added a commit that referenced this pull request Sep 20, 2019
* starting to add context for 0.4

Signed-off-by: Scott Nichols <nicholss@google.com>

* Enabling Pub/Sub to send and receive from multiple topics and subscriptions. (#171)

Signed-off-by: Scott Nichols <nicholss@google.com>

* Code and examples for proposed changes/additions to transport APIs (#164)

Please see the code and doc for details.

Signed-off-by: Alan Conway <aconway@redhat.com>
Signed-off-by: Scott Nichols <nicholss@google.com>

* fix a syntax error in a logw line. (#174)

Signed-off-by: Scott Nichols <nicholss@google.com>

* Changing Send signature: Adding Context return param (#177)

Signed-off-by: nachocano <nachoacano@gmail.com>
Signed-off-by: Scott Nichols <nicholss@google.com>

* Renamed pkg/cloudevents/transport/x to pkg/binding (#181)

Main types are binding.Message, binding.Sender and binding.Receiver which
reads well in code, corresponds to CE spec use of the term "binding", and
avoids clashes with existing package name "transport".

Part of #180 - The AMQP transport will be re-factored to use this package.

Signed-off-by: Alan Conway <aconway@redhat.com>
Signed-off-by: Scott Nichols <nicholss@google.com>

* fix extra header write. (#179)

Signed-off-by: Scott Nichols <nicholss@google.com>

* fix codec v0.3 double quote encoding (#184)

Signed-off-by: Diego Marangoni <diegomarangoni@me.com>
Signed-off-by: Scott Nichols <nicholss@google.com>

* Propagate pubsub subscriber errors (#185)

* Found a blocking issue on pubsub transport if a subscriber had an error.

Signed-off-by: Scott Nichols <nicholss@google.com>

* make sure cancel is called

Signed-off-by: Scott Nichols <nicholss@google.com>

* go mod.

Signed-off-by: Scott Nichols <nicholss@google.com>
Signed-off-by: Scott Nichols <nicholss@google.com>

* Fix nil pointer exception in codec timestamp handling (#187)

Signed-off-by: Scott Nichols <nicholss@google.com>

* Leaked a debug line. (#189)

Signed-off-by: Scott Nichols <nicholss@google.com>

* preping for v1.0, adjusting the interfaces.

Signed-off-by: Scott Nichols <nicholss@google.com>

* fix a typo on the godoc.

Signed-off-by: Scott Nichols <nicholss@google.com>
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

Successfully merging this pull request may close these issues.

2 participants