-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for bulk rest publish API #439
Conversation
7814485
to
aa98075
Compare
Interesting. Is this meant to be a working prototype towards adding this to the spec later? Perhaps in 1.2? |
Yes, that's the question I suppose. |
Are we sure adding a rest#publish here isn't going to limit our options later? E.g. if we later decide on a spec for batch publishing in 1.2 that differs from this (e.g. say we decide we want more flexibility wrt channelOptions than this implementation allows, i.e. we don't want to assume that every channel in the batchspec will have the same encryption key), is it possible we'll then have a backwards compatibility issue? I suppose that may be less of a problem with java as the method could just be overloaded with a different signature (in that example, one without a ChannelOptions). We also have early discussions re adding a more general client#publish. Again maybe less of an issue with java as such a method would have a different signature, but for more dynamic languages we may want batch-publish and normal-publish-but-on-the-client methods to have different names, so we don't have to detect whether a passed in array is an array of batchspecs or an array of messages. And then for cross-lib consistency we'd want java to use the same names. Which would imply we might want to call this method something other than |
Would it be acceptable to mark the API experimental or beta with an annotation? That is a common pattern in other libraries, which leaves space for early access to APIs while also accounting for future changes when it becomes standard. |
Googling around the consensus seems to be to have an |
Annotations are easy to create, I think it's really more about the documentation it provides paired with javadoc and a disclosure in the API docs. |
I don't know tbh but, give that, I'm ok to name it See 98c072f |
fe18cc7
to
e82abdd
Compare
a9f7e93
to
67ad67d
Compare
This adds support for the bulk publish API:
This performs a publish in parallel of messages to channels specified in the request body.
A single
BatchSpec
is an object of the form:where:
<channels>
is a single channel nameString
, or anArray
of channel nameStrings
; and<messages>
is a singleMessage
, or anArray
ofMessage
s.The bulk publish endpoint accepts a request body containing either a single
BatchSpec
object, or an array ofBatchSpec
objects.Therefore the following are all valid request bodies for a bulk publish request:
There is an obvious mapping from the request body to the array of individual publish requests.