3

I'm using Channel API on Google Appengine to send updates from my server application to the frontend. Frontend is built with AngularJS.

This works fine in GAE devserver, but when I deploy to production no messages are received in frontend. There are no error messages in Backend or Frontend.

Here are code snippets to show how my implementation works:

  1. Client requests new Channel via HTTP GET
  2. Server creates new Channel and sends back channel token:

    ChannelService service = ChannelServiceFactory.getChannelService();
    String token = service.createChannel(client, CHANNEL_VALID_DURATION);
    
  3. Client opens new channel:

    channel = new goog.appengine.Channel(token);
    socket = channel.open();
    socket.onopen = onOpened;
    

    onOpend Method is called

  4. Server sends message to client via channel

    ChannelService channelService = ChannelServiceFactory.getChannelService();
    channelService.sendMessage(new ChannelMessage(token, message));
    

I can see from my logs that this sendMessage is called in Backend, but I don't receive any message in frontend.

Are there any settings in AppEngine to get ChannelApi working?

Zeehad
  • 1,012
  • 1
  • 9
  • 11
Ruben
  • 31
  • 1
  • Are you using modules? (see https://code.google.com/p/googleappengine/issues/detail?id=10293) The people having this problem in the issue suggest that you have to send messages from within the same module in which you created the channel. So you might be able to move both to the default module and send messages via Task Queue? Also incoming messages could be dispatched by the default module. – konqi Feb 05 '16 at 09:53
  • Yes, I am using modules. Thanks for this hint! – Ruben Feb 06 '16 at 21:38

0 Answers0