Google Certified Professional Data Engineer

Sign Up Free or Log In to participate!

pubsub returns only first message with limit = 3 first time 2nd time it returns 3 messages.

@cloudshell:~ (poetic-genius-271117)$ gcloud pubsub subscriptions pull Labsub3 –auto-ack –limit=3

┌───────┬──────────────────┬────────────┬──────────────────┐

│ DATA │ MESSAGE_ID │ ATTRIBUTES │ DELIVERY_ATTEMPT │

├───────┼──────────────────┼────────────┼──────────────────┤

│ Yho 1 │ 1427032616808217 │ │ │

└───────┴──────────────────┴────────────┴──────────────────┘

@cloudshell:~ (poetic-genius-271117)$ gcloud pubsub subscriptions pull Labsub3 –auto-ack –limit=3

┌───────────┬──────────────────┬────────────┬──────────────────┐

│ DATA │ MESSAGE_ID │ ATTRIBUTES │ DELIVERY_ATTEMPT │

├───────────┼──────────────────┼────────────┼──────────────────┤

│ Yho 1+1=2 │ 1427031684530098 │ │ │

│ Yho 2+1=3 │ 1427032940823233 │ │ │

│ Yho 2+2=4 │ 1427031469909841 │ │ │

└───────────┴──────────────────┴────────────┴──────────────────┘

Ankit Kumar Singh

Hey Anoop….Limit is just to read only 3 messages when if you have more than 3 messages ready for pull but if you have less than 3 messages ready for pull then it displays only those. In your case, during first run only one message was ready to be pulled and then next time, there were three messages ready to be pulled so it displays all three. There were 4 messages into your topic as shown by distinct 4 message ids.

0 Answers

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?