You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (JIRA)" <ji...@apache.org> on 2016/09/02 08:53:20 UTC
[jira] [Comment Edited] (CAMEL-10280) Don't require create
privileges to publish to named SNS topic
[ https://issues.apache.org/jira/browse/CAMEL-10280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15457973#comment-15457973 ]
Andrea Cosentino edited comment on CAMEL-10280 at 9/2/16 8:52 AM:
------------------------------------------------------------------
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 (if this is what you meant)?
was (Author: ancosen):
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)