[ 
https://issues.apache.org/jira/browse/BEAM-13653?focusedWorklogId=712983&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-712983
 ]

ASF GitHub Bot logged work on BEAM-13653:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Jan/22 17:04
            Start Date: 21/Jan/22 17:04
    Worklog Time Spent: 10m 
      Work Description: mosche commented on a change in pull request #16503:
URL: https://github.com/apache/beam/pull/16503#discussion_r789843880



##########
File path: 
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/sns/SnsIO.java
##########
@@ -385,6 +378,15 @@ private static boolean isTopicExists(SnsClient client, 
String topicArn) {
       return result;
     }
 
+    private boolean checkTopicExists() {
+      try (SnsClient client = getSnsClientProvider().getSnsClient()) {
+        client.getTopicAttributes(b -> b.topicArn(getTopicArn()));
+        return true;
+      } catch (NotFoundException | InvalidParameterException e) {
+        return false;

Review comment:
       👍  will add logs 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 712983)
    Time Spent: 40m  (was: 0.5h)

> Improved handling of topicArn in SnsIO.write 
> ---------------------------------------------
>
>                 Key: BEAM-13653
>                 URL: https://issues.apache.org/jira/browse/BEAM-13653
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-aws
>            Reporter: Moritz Mack
>            Assignee: Moritz Mack
>            Priority: P2
>              Labels: aws, aws-sdk-v2
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Usage of SnsIO.write is rather unintuitive at the moment.
> topicArn is a required configuration and during expansion the existence of 
> the topic is validated.
> However, the user also has to provide a function to build an SNS publish 
> request. The topicArn for that publish request has to be set as well, but can 
> be different from the one configured and validated in the writer. 
> This is confusing and makes any validation pointless.
> Also, when validating the SNS client instance is not closed.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to