Skip to content

Commit 90aba8b

Browse files
Pub/Sub: add note for high volume push requests (GoogleCloudPlatform#1567)
1 parent 4c46c4a commit 90aba8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

appengine-java8/pubsub/src/main/java/com/example/appengine/pubsub/PubSubAuthenticatedPush.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp)
7171

7272
try {
7373
// Verify and decode the JWT.
74+
// Note: For high volume push requests, it would save some network overhead
75+
// if you verify the tokens offline by decoding them using Google's Public
76+
// Cert; caching already seen tokens works best when a large volume of
77+
// messsages have prompted a singple push server to handle them, in which
78+
// case they would all share the same token for a limited time window.
7479
GoogleIdToken idToken = verifier.verify(authorization);
7580
messageRepository.saveToken(authorization);
7681
messageRepository.saveClaim(idToken.getPayload().toPrettyString());

0 commit comments

Comments
 (0)