title: Google Pub/Sub reuse existing subscription
body: <p>I have created java pub/sub consumer relying on the following pub/sub <a href="https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-pubsub#pulling-messages" rel="nofollow noreferrer">doc</a>.</p>
  
  <pre><code>public static void main(String... args) throws Exception {
  
          TopicName topic = TopicName.create(pubSubProjectName, pubSubTopic);
          SubscriptionName subscription = SubscriptionName.create(pubSubProjectName, "ssvp-sub");
  
          SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create();
          subscriptionAdminClient.createSubscription(subscription, topic, PushConfig.getDefaultInstance(), 0);
  
          MessageReceiver receiver =
                  new MessageReceiver() {
                      @Override
                      public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
                          System.out.println("Got message: " + message.getData().toStringUtf8());
                          consumer.ack();
                      }
                  };
          Subscriber subscriber = null;
          try {
              subscriber = Subscriber.defaultBuilder(subscription, receiver).build();
              subscriber.addListener(
                      new Subscriber.Listener() {
                          @Override
                          public void failed(Subscriber.State from, Throwable failure) {
                              // Handle failure. This is called when the Subscriber encountered a fatal error and is shutting down.
                              System.err.println(failure);
                          }
                      },
                      MoreExecutors.directExecutor());
              subscriber.startAsync().awaitRunning();
  
              Thread.sleep(60000);
          } finally {
              if (subscriber != null) {
                  subscriber.stopAsync();
              }
          }
      }
  </code></pre>
  
  <p>It works well, but every run it ask for a new subscriber name by throwing <em>StatusRuntimeException</em> exception.</p>
  
  <pre><code>io.grpc.StatusRuntimeException: ALREADY_EXISTS: Resource already exists in the project (resource=ssvp-sub).
  </code></pre>
  
  <p>(see <em>SubscriptionName.create(pubSubProjectName, "ssvp-sub") line in my code snippet</em>)</p>
  
  <p>I found out that in node.js client we can pass <em>"reuseExisting:true"</em> option to reuse existing subscription :</p>
  
  <pre><code>topic.subscribe('maybe-subscription-name', { reuseExisting: true }, function(err, subscription) {
    // subscription was "get-or-create"-ed
  });
  </code></pre>
  
  <p>What option should I pass if I use official java pubsub client?:</p>
  
  <pre><code> &lt;dependency&gt;
        &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
        &lt;artifactId&gt;google-cloud-pubsub&lt;/artifactId&gt;
        &lt;version&gt;0.13.0-alpha&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>