Releases: googleapis/nodejs-pubsub
v0.16.5
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
Features
With this release the PubSub module is moved to a separate repository. The code in v1/ folder was regenerated, and while there should not be any compatibility issues, please feel free to report any issues you might find.
v0.15.0
- #2744: The Pub/Sub IAM API now allows more control of each API request, referred to as
gaxOptions
. Refer to the IAM documentation for more information.
v0.14.1
v0.14.0
@google-cloud/pubsub 0.14.0 Beta Release
@google-cloud/pubsub
is now a Beta API. Libraries defined at the Beta quality level are expected to be mostly stable, while we work towards their release can
didate. We will address issues and requests with a higher priority.
⚠️ Breaking Changes
PubSub received a small redesign!
Publishing Messages
When publishing messages we no longer allow data to come in the form of Strings or Objects, instead you must pass in a Buffer object. Attributes can now be passed in as a second optional parameter. Messages are batched together, so calling publish()
multiple times will not result in multiple requests.
Before
var messages = [
'foo',
'bar'
];
topic.publish(message, function(err, messageIds, apiResponse) {});
After
var publisher = topic.publisher();
var callback = function(err, messageId, apiResponse) {};
var message1 = new Buffer('foo');
publisher.publish(message1, callback);
var message2 = new Buffer('bar');
var attributes = {
key: 'value'
};
publisher.publish(message2, attributes, callback);
Message Handling
message.ack()
no longer accepts a callback function, instead errors will be reported viasubscription.on('error', function(err) {})
message.skip()
has been removed in favor ofmessage.nack()
Before
subscription.on('message', function(message) {
// Ack the message
message.ack(function(err) {});
// Skip the message
message.skip();
});
After
subscription.on('message', function(message) {
// Ack the message (No longer accepts a callback)
message.ack();
// Do not ack the message, allowing more messages to come in
message.nack();
});
subscription.pull()
removed.
Please open an issue with any feedback, questions, or issues. We're happy to help during the transition.