camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Fussenegger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10280) Don't require create privileges to publish to named SNS topic
Date Thu, 01 Sep 2016 10:19:21 GMT

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

Stefan Fussenegger commented on CAMEL-10280:
--------------------------------------------

not right now. I think it would take more time to get the project set up locally.

it should pretty much come down to this though:

{code:java}
try {
	String nextToken = null;
	final String arnSuffix = ":" + configuration.getTopicName();
	do {
		final ListTopicsResult response = snsClient.listTopics(nextToken);
		nextToken = response.getNextToken();

		for (final Topic topic : response.getTopics()) {
			if (topic.getTopicArn().endsWith(arnSuffix)) {
				configuration.setTopicArn(topic.getTopicArn());
				break;
			}
		}

	} while (nextToken != null);
} catch (final AuthorizationErrorException e) {
	// not sure this is the right exception to catch
	LOG.trace("Not able to list topics due to insufficient permissions");
}
{code}



> 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)

Mime
View raw message