Need to read older messages in pub/sub subscription queue

1,425 views
Skip to first unread message

Aslam Khan

unread,
May 5, 2021, 9:12:48 AM5/5/21
to pubsub-discuss
I have a backlog of 3.6K and wanted to pull old messages [may be from a day or 2 day old]. I couldnt be able to do it with  gcloud pubsub subscriptions pull . Is there a way to handle it?

Mohammad I (Cloud Platform Support)

unread,
May 6, 2021, 9:41:06 AM5/6/21
to pubsub-discuss

You may consider to use the seek feature which allows users to extends subscriber functionality by allowing to alter the acknowledgement state of messages in bulk (ie. replay previously acknowledged messages or purge messages in bulk). 

It can work by seeking to a timestamp which marks every message received by Pub/Sub before the time as acknowledged, and all messages received after the time as unacknowledged. Another way is seeking to a snapshot which allows capturing the message acknowledgment state of a subscription.

This YouTube video provides further details into it and this quickstart for working examples.  

Kir Titievsky

unread,
May 6, 2021, 9:52:40 AM5/6/21
to Mohammad I (Cloud Platform Support), pubsub-discuss
Aslam, when you say you were not able to pull it with gcloud, can you say what happened? Are you getting errors? Is it to slow?

--
You received this message because you are subscribed to the Google Groups "pubsub-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/9f390a8d-6608-43e2-b302-7511e9480c90n%40googlegroups.com.


--
Kir Titievsky | Product Manager | Google Cloud Pub/Sub 

Aslam Khan

unread,
May 6, 2021, 3:49:16 PM5/6/21
to pubsub-discuss
Kir,

We had 3.6k backlog of messages in a subscription. I wanted to pull a message from the backlog from UI or command line and it doesnt return anything.

Also, is there any way to seek a old message in the queue not the latest one.

Kir Titievsky

unread,
May 7, 2021, 6:36:07 PM5/7/21
to Aslam Khan, pubsub-discuss
So no errors?  If so, when you look at the subscription details page, what is the "unacked message count" graph showing? 



Reply all
Reply to author
Forward
0 new messages