GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Weird behavior when pulling messages and using modifyAckDeadline · Issue #1017 · googleapis/google-cloud-java Closed Labels api: pubsubIssues related to the Pub/Sub API. DescriptionThe scenario is the following: 1 topic and 1 subscription with default ack deadline (10 seconds). I publish 2 messages ( After the first pull I set the ack deadline of When I run this scenario against the actual service I get the weird behavior: pull requests made before that ~100 seconds are passed after the deadline modification return no messages (as if both messages where affected by The veneer toolkit code that reproduces the error is the following: PublisherApi publisher = PublisherApi.create(publisherSettings); SubscriberApi subscriber = SubscriberApi.create(subscriberSettings); String topicName = PublisherApi.formatTopicName("gcloud-devel", "test-topic"); String subscriptionName = SubscriberApi.formatSubscriptionName("gcloud-devel", "test-subscription"); publisher.createTopic(topicName); subscriber.createSubscription(Subscription.newBuilder() .setName(subscriptionName) .setTopic(topicName) .setAckDeadlineSeconds(10) .build()); publisher.publish(topicName, ImmutableList.of( PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8("message1")).build(), PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8("message2")).build())); PullResponse pullResponse = subscriber.pull(subscriptionName, true, 2); List<ReceivedMessage> receivedMessages = pullResponse.getReceivedMessagesList(); for (ReceivedMessage message : pullResponse.getReceivedMessagesList()) { System.out.printf("[%d][PULLED MESSAGE %s]%n", System.currentTimeMillis(), message.getMessage().getData().toStringUtf8()); } // Set the deadline of the first message far away subscriber.modifyAckDeadline(subscriptionName, ImmutableList.of(receivedMessages.get(0).getAckId()), 100); // Second message should be again available for pulling after .sleep() Thread.sleep(20000); for (int i = 0; i < 10; i++) { pullResponse = subscriber.pull(subscriptionName, true, 2); receivedMessages = pullResponse.getReceivedMessagesList(); if (receivedMessages.isEmpty()) { System.out.printf("[%d][PULLED NO MESSAGES]%n", System.currentTimeMillis()); } else { for (ReceivedMessage message : pullResponse.getReceivedMessagesList()) { System.out.printf("[%d][PULLED MESSAGE %s]%n", System.currentTimeMillis(), message.getMessage().getData().toStringUtf8()); } } Thread.sleep(20000); } publisher.deleteTopic(topicName); subscriber.deleteSubscription(subscriptionName); When I run it against the actual service I get the following output: [1463750536877][PULLED MESSAGE message1] [1463750536877][PULLED MESSAGE message2] [1463750561558][PULLED NO MESSAGES] // <-- here and in the following I would expect message2 [1463750584638][PULLED NO MESSAGES] [1463750608178][PULLED NO MESSAGES] [1463750631240][PULLED NO MESSAGES] [1463750653656][PULLED MESSAGE message1] [1463750653657][PULLED MESSAGE message2] [1463750676241][PULLED MESSAGE message1] [1463750676241][PULLED MESSAGE message2] [1463750698302][PULLED MESSAGE message1] [1463750698302][PULLED MESSAGE message2] [1463750720269][PULLED MESSAGE message1] [1463750720270][PULLED MESSAGE message2] [1463750742847][PULLED MESSAGE message1] [1463750742847][PULLED MESSAGE message2] Instead when I run it agains the emulator the output is as expected: [1463749875238][PULLED MESSAGE message1] [1463749875238][PULLED MESSAGE message2] [1463749895270][PULLED MESSAGE message2] [1463749915289][PULLED MESSAGE message2] [1463749935308][PULLED MESSAGE message2] [1463749955329][PULLED MESSAGE message2] [1463749975347][PULLED MESSAGE message1] [1463749975347][PULLED MESSAGE message2] [1463749995363][PULLED MESSAGE message1] [1463749995363][PULLED MESSAGE message2] [1463750015384][PULLED MESSAGE message2] [1463750015384][PULLED MESSAGE message1] [1463750035403][PULLED MESSAGE message2] [1463750035403][PULLED MESSAGE message1] [1463750055421][PULLED MESSAGE message2] [1463750055422][PULLED MESSAGE message1] @eschapira @garrettjonesgoogle Any idea about what's going on? Activity
MetadataMetadataAssigneesLabelsapi: pubsubIssues related to the Pub/Sub API. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |