is it possible listen to a pub/sub topic without a subscription?

1,465 views
Skip to first unread message

Nick Pomfret

unread,
Oct 29, 2018, 11:57:25 AM10/29/18
to Google App Engine
I'm wondering if it's possible to broadcast messages on a topic and have a process listen to them but without a subscription?

The reason is that I don't care about losing messages if say my application was switched off.  And when it's switched back on I only want to receive message published since the moment it was switched on.

Julie (cloud platform support)

unread,
Oct 29, 2018, 2:12:17 PM10/29/18
to Google App Engine
According to this Pub/Sub FAQ question trying to publish a topic without subscriptions will result in the messages being dropped, however the publish operation should succeed which you can use to confirm that your application is switched on. 

Nick Pomfret

unread,
Oct 30, 2018, 9:00:57 AM10/30/18
to google-a...@googlegroups.com
I'm not sure I understand your answer.

Maybe my question was unclear...  I am publishing messages onto  a topic.  If my app isn't running I'm happy for those messages to disappear. AND I don't want a backlog of messages when I switch my app on.  I want topic behaviour, not queue behaviour (which is what I'm getting when I create a subscriber).



On Mon, 29 Oct 2018 at 18:12, 'Julie (cloud platform support)' via Google App Engine <google-a...@googlegroups.com> wrote:
According to this Pub/Sub FAQ question trying to publish a topic without subscriptions will result in the messages being dropped, however the publish operation should succeed which you can use to confirm that your application is switched on. 

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/6c16c539-c96e-409b-b28e-6d53035d9804%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Olu

unread,
Oct 30, 2018, 11:50:22 AM10/30/18
to Google App Engine
By design, for every subscription the Google Cloud PubSub delivers messages at least once. Hence, even if the subscriber is not present, the unacknowledged messages are stored in a persistent storage for 7 days after the messages are published. 

The documentation explains the exceptions to the "at least once delivery" approach of the Cloud PubSub and why a message would be deleted. Messages published before a subscription is created would not be retrievable. Also, a maximum retention of 7 days, after which the message would be deleted.

Hence, it is intended behavior that your Subscriber would still be able to retrieve backlogs of messages (that are under 7 days), even if it was off for some time.

Olu

unread,
Oct 30, 2018, 12:01:35 PM10/30/18
to Google App Engine
If you want a feature that offers a different behavior on Cloud PubSub, I recommend reporting this Feature Request on the Issue tracker. The Feature request would be submitted to the PubSub Engineers. However, Feature Requests are subject to evaluations and there are usually no ETA for the implementation. 
Reply all
Reply to author
Forward
0 new messages