Professional Data Engineer Exam QuestionsBrowse all questions from this exam

Professional Data Engineer Exam - Question 20


You work for a car manufacturer and have set up a data pipeline using Google Cloud Pub/Sub to capture anomalous sensor events. You are using a push subscription in Cloud Pub/Sub that calls a custom HTTPS endpoint that you have created to take action of these anomalous events as they occur. Your custom

HTTPS endpoint keeps getting an inordinate amount of duplicate messages. What is the most likely cause of these duplicate messages?

Show Answer
Correct Answer: BD

In Google Cloud Pub/Sub, duplicate messages can occur if the custom endpoint does not acknowledge the messages within the acknowledgement deadline. When a push subscription is used, Pub/Sub expects an acknowledgment from the endpoint to confirm that the message has been received and processed. If this acknowledgment is not received within the set deadline, Pub/Sub assumes the message was not processed successfully and will attempt to redeliver it, resulting in duplicate messages. Hence, ensuring that the custom HTTPS endpoint acknowledges messages promptly is crucial to prevent this situation.

Discussion

17 comments
Sign in to comment
jvg637Option: D
Mar 11, 2020

The Answer should be D. The custom endpoint is not acknowledging the message, that is the reason for Pub/Sub to send the message again and again. Not B.

[Removed]Option: D
Mar 18, 2020

Answer D. https://cloud.google.com/pubsub/docs/troubleshooting#dupes

dgteixeiraOption: D
Jun 9, 2023

The correct answer is D, because it's how Pub/Sub works. Documentation here: https://cloud.google.com/pubsub/docs/troubleshooting#dupes

FP77Option: D
Jul 28, 2023

It should be D https://cloud.google.com/pubsub/docs/troubleshooting#dupes

GCPproOption: D
Jan 10, 2023

D is the correct answer.

niketdOption: D
Feb 23, 2023

No acknowledgment -> Answer B. Moderators please update your answer

juliobsOption: D
Mar 17, 2023

D for sure

boca_2022Option: D
May 1, 2023

D for sure

imran79Option: D
Oct 7, 2023

The correct answer is: D. Your custom endpoint is not acknowledging messages within the acknowledgement deadline.

rtcpostOption: D
Oct 22, 2023

In Google Cloud Pub/Sub, when you use a push subscription, messages are delivered to the specified endpoint (in this case, your custom HTTPS endpoint). The acknowledgment deadline is the time given to the endpoint to acknowledge that it has received and processed the message. If the acknowledgment is not received within the deadline, Pub/Sub may consider the message as unacknowledged and may attempt redelivery, which can lead to duplicate messages. You should ensure that your custom HTTPS endpoint acknowledges messages within the acknowledgment deadline to prevent duplicate messages from being sent. Additionally, it's essential to handle messages in an idempotent way, so even if duplicates do occur, the action taken by your endpoint doesn't have unintended consequences.

bha11111Option: D
Mar 11, 2023

d is correct

itsmynicknameOption: D
Jul 9, 2023

I mistakenly answered by D, but it's indeed B. Here is the explanation: https://www.youtube.com/watch?v=KObJkda4ZfY

marek_skopowski
Jul 12, 2023

And where exactly in this video it's stated that this is caused by the invalid cert?

emmylouOption: D
Oct 3, 2023

if there were an out of date certificate then nothing would get through. D

philli1011Option: D
Jan 25, 2024

D should be the answer. If acknowlegement is not received back to pub/sub , pub/sub may resend meassages.

searching4alicenseOption: D
Mar 1, 2024

D - If a message has not been acknowledged within its acknowledgement deadline, Dataflow attempts to maintain the lease on the message by repeatedly extending the acknowledgement deadline to prevent redelivery from Pub/Sub. However this is best effort and there is a possibility that messages may be redelivered. This can be monitored using metrics listed here. https://cloud.google.com/blog/products/data-analytics/handling-duplicate-data-in-streaming-pipeline-using-pubsub-dataflow

VictorBaOption: D
May 24, 2024

Agree with previous explanations regarding validity of D

petergjohnsonOption: B
Jun 27, 2024

After re-reading the question it seem to me that it is asking for a root cause. It is possible that the most common cause of this symptom is and expired certificate. Once expired duplicates would be received for every message.