We have an architecture using 2 pubsub topic/subscription pairs:
T1 is triggered by a cronjob periodically (every 5
I ran into the same problem, I wanted better control over .ack(). Looking at the nodejs library from google, it would an option to refactor the ack() to return a promise so the function can wait for ack()to complete.
Subscriber.prototype.ack_ = function(message) {
var breakLease = this.breakLease_.bind(this, message);
this.histogram.add(Date.now() - message.received);
if (this.writeToStreams_ && this.isConnected_()) {
this.acknowledge_(message.ackId, message.connectionId).then(breakLease);
return;
}
this.inventory_.ack.push(message.ackId);
this.setFlushTimeout_().then(breakLease);
};