title: How to subscribe a SQS queue to a SNS topic in Java
body: <p>When I create a new queue and subscribe it to a topic in Java, no message comes. The same via the AWS web console works fine. </p>
  
  <p>I guess I have to confirm the subscription somehow, but the <code>sns.confirmSubscription</code> method needs a token - where shall I get it?</p>
  
  <p>This is my Java code:</p>
  
  <pre><code>String queueURL = sqs.createQueue("my-queue").getQueueUrl();
  
  sns.subscribe(myTopicARN, "sqs", queueURL);
  
  sns.publish(myTopicARN, "{\"payload\":\"test\"}");
  
  sqs.receiveMessage(queueURL).getMessages()
          .forEach(System.out::println);  // nothing
  </code></pre>
  
  <p>What am I doing wrong?</p>