title: what are the retry settings for subscriber in pubsub and how to set them correctly in a spring application?
body: <p>I have a spring service subcribing for messages from a topic in the google cloud pubsub (pulling). It is working correctly in general. But I want to have more control over resent messages. My service need sometimes to nack the message or just let the ackDeadline pass so that I would get the message later on again. While testing with single messages, the nacked message comes back to me almost immidetaly, and the ones I don't ack or nack at all, come back after 10 sec default for ackDeadline. I would like it to postpone the repeated consuming of these messages. I thought the retry setting are designed for such cases. 
  I should mention as well that I am currently testing locally with an emulator and create the subscription from code. I am using the PubSubAdmin for managing. </p>
  
  <p>According to this <a href="https://docs.spring.io/spring-cloud-gcp/docs/1.1.0.M1/reference/html/_spring_cloud_gcp_for_pub_sub.html#pubsub-configuration" rel="nofollow noreferrer">docu</a> I have tried to set those configuration in my profile config. like this:</p>
  
  <pre><code>spring.cloud.gcp.pubsub.subscriber.retry.initial-retry-delay-second: 4
  spring.cloud.gcp.pubsub.subscriber.retry.max-attempts: 5
  spring.cloud.gcp.pubsub.subscriber.retry.initial-rpc-timeout-seconds: 4
  spring.cloud.gcp.pubsub.subscriber.retry.max-rpc-timeout-seconds: 8
  spring.cloud.gcp.pubsub.subscriber.retry.max-retry-delay-seconds: 7
  spring.cloud.gcp.pubsub.subscriber.retry.total-timeout-seconds: 3000
  </code></pre>
  
  <p>but it had no effect on the time of reoccuring of the messages. 
  Do I understand the meaning of retry settings wrongly? maybe they only take effect if there are some connection problems but not in nacking or lacking of acknowledgment cases? Or do I have to set the setting while using deploymentManager for creating the subscriptions and am not allowed to set them from the code? Or maybe setting them in (development) profile configs won't work with the PubSubAdmin?
  Thanks for any suggestions!</p>
  
  <p>edit: I want the first retry to happen after 5 seconds, but next retry 10 seconds later, etc. Plus I want to set the max retry number. So what I am not interested in is setting the ackDeadline just to a bigger number.</p>
  
  <p>edit2: why nacking: one of the services (let's call it a bridge) is subscribing for the messages, has to validate each message and if ok pass it to another external system. this service is acting as a bridge for this system, as we can't work on this second system directly. in some cases the message need some extra information, so the bridge will try to fetch it somewhere else (there are a lot of microservices included) and it happens sometimes, that at this moment in time the extra information is not there (yet). So the first idea was to not ack the message and let it come later again. but I don't want to ask every 10 sec for the next 7 days (with ackDeadline), I want to just try few times, and if it is not there after 2 hours, it will never came. so we tried to nack and hoped those retry settings can help to manage the resending. But as they don't, I suppose the only way to go will be to build something for managing these messages in the bridge by myself. Maybe store message ids and the number of retry so that I can ack after for example 5 times and push the message to another topic to deal with it differently. Or are there any better solutions known?</p>