I am using Google Cloud Pubsub for my application. The subscriber to the pubsub topic is written in Javascript and runs on Nodejs. I am using the official pubsub client provided by google.
The code looks like this:
var topic = gcloud.pubsub({projectId: 'myProjectId'}).topic('topicName');
var pubsub = gcloud.pubsub({projectId: 'myProjectId'});
var sub = pubsub.subscription('subName', {topic: topic});
sub.on('error', function(err) { console.error(err); });
sub.on('message', messageHandler);
My error handler keeps getting triggered with this error message:
Error: Max message size exceeded
First of all, this is a very strange message to be receiving on the subscriber. If the message is too large, it should have been rejected when it was published.
Much more importantly, is that my subscriber just seems to die at some point. It keeps processing these messages until about 80 errors and then just stops. The message handler never gets called again.
How can I fix this?
Updated SDK version to 0.46.1. New error message:
Received message larger than max (10406691 vs. 4194304)