Standard Environment PubSub Publish Message

126 views
Skip to first unread message

dan...@gmail.com

unread,
Jul 13, 2017, 12:10:51 PM7/13/17
to google-appengine-go
Hi All,

I'm working with the standard environment and I have a Front End and a Service.

The service/module that receives messages from a PubSub Topic and write them to storage. This works and by using the console I can place message on the Topic and they get written to disk. What I'm now trying to achieve is being able to re-spin the messages on disk back into the topic from the front end.

The problem I have is that I have been unable to put a message onto the topic from the front end. If I wait for PubSub (with the get(ctx)) I get "Process terminated because the request deadline was exceeded. (Error code 123)" . Fair enough, so I thought to use the RunInBackground function within the runtime package. I get the following error "API error 2 (system: BACKEND_REQUIRED)" but I'm not sure why?

Does anyone have an example of sending a message to a PubSub topic from the AppEngine Standard Environment that I could utilise to work out what I've done wrong?

Or am I using the incorrect tool and should I be looking at using the TaskQueue and then using the TaskQueue to create the message and put it back on the topic (Seems a little like creating a message on a queue to create a message on a topic)?

Thanks, Dan

dan...@gmail.com

unread,
Jul 20, 2017, 8:45:48 AM7/20/17
to google-appengine-go
I've put together a basic example to show the issue:

https://github.com/d2g/dg-pubsubtest

When waiting for the `get` on the publish result i get this in the :
2017/07/20 12:28:20 Unsolicited response received on idle HTTP channel starting with "HTTP/1.1 408 Request Timeout\r\nContent-Length: 0\r\nContent-Type: text/plain\r\n\r\n"; err=<nil>

I even tried the task queue method I mentioned earlier which still has no success.

If anyone can see the issue i'd appreciate it, otherwise I'll log it as a defect against the pubsub go client.

dan...@gmail.com

unread,
Jul 21, 2017, 6:44:08 AM7/21/17
to google-appengine-go
Reply all
Reply to author
Forward
0 new messages