google-app-enginechannel-api

Too many internal channel errors while using Channel API


We use Channel API in our Google App Engine application to send updates to our users. The code to send updates is something like this

for(String clientID: listOfClientID)
    channelService.sendMessage(new ChannelMessage(clientID, stringMessage));

Over the past few weeks, we've been getting too many exceptions in this method. We get around around 150 exceptions for a 8-hour peak usage period.

com.google.appengine.api.channel.ChannelFailureException: An internal channel error occured.

The loop can have 500-3000 iterations. Is it a problem when ChannelService tries to send a message to a channel that has been closed? If I remove closed channels from the list, will it completely solve the problem? Please note that this large number of exceptions have been a trend only in the past few weeks and we've been using Channel API for several months.


Solution

  • Turns out that the problem was the server trying to send messages to channels that have expired. The error rate has gone down considerably when I made sure that doesn't happen anymore.