[ 
https://issues.apache.org/jira/browse/CAMEL-10280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15457973#comment-15457973
 ] 

Andrea Cosentino commented on CAMEL-10280:
------------------------------------------

We have 

{code}
        if (configuration.getTopicArn() == null) {
            // creates a new topic, or returns the URL of an existing one
            CreateTopicRequest request = new 
CreateTopicRequest(configuration.getTopicName());

            LOG.trace("Creating topic [{}] with request [{}]...", 
configuration.getTopicName(), request);

            CreateTopicResult result = snsClient.createTopic(request);
            configuration.setTopicArn(result.getTopicArn());

            LOG.trace("Topic created with Amazon resource name: {}", 
configuration.getTopicArn());
        }
{code}

We can add a control before creating the topic and if we have an ARN, we can 
skip the creation. What do you think about this approach?

> Don't require create privileges to publish to named SNS topic
> -------------------------------------------------------------
>
>                 Key: CAMEL-10280
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10280
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-aws
>    Affects Versions: 2.17.3, 2.18.0
>            Reporter: Stefan Fussenegger
>            Assignee: Andrea Cosentino
>
> If a topic already exists, the {{SnsEndpoint}} still requires privileges for 
> the (idempotent) {{CreateTopic}} operation to resolve the name to an ARN.
> In comparison, the {{SqsEndpoint}} uses the {{ListQueues}} operation to check 
> for an existing queue before trying to create a queue.
> Providing an ARN instead of a name bypasses the issue (added to 2.18 in 
> CAMEL-9844). Using an ARN instead of a name isn't always practical though.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to