Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

AWS SNS + Camel + "amazonSNSEndpoint" being ignored?

$
0
0
Hello folks, wondering if you have come across this issue, or if there is
something simple I am doing wrong.

I am using the SNS Camel component, declared as:

/*<bean name="snsClient" class="com.amazonaws.services.sns.AmazonSNSClient">
<constructor-arg>
<bean class="com.amazonaws.auth.BasicAWSCredentials">
<constructor-arg value="${access.key}"/>
<constructor-arg value="${secret.key}"/>
</bean>
</constructor-arg>
</bean>*/

And in my routebuilder, I have created the following route like so;

*/Exchange exchange2 =
producer.send("aws-sns://TabcorpTopic?amazonSNSClient=#snsClient",
new Processor() {
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(SnsConstants.SUBJECT, "This is
my subject");
exchange.getIn().setBody("This is my message text.");

});

// Simply print out the message id.
System.out.println("Message ID: " +
exchange2.getIn().getHeader(SnsConstants.MESSAGE_ID));/*

Which works fine, I can subscribe to the topic and receive my notifications,
however, when I try to add the amazonSNSEndpoint=ap-southeast-2 parameter to
change to the Sydney region, it seems to be ignored?

*Exchange exchange2 =
producer.send("aws-sns://TabcorpTopic?amazonSNSClient=#snsClient橦뎢璍䡉?袧=ap-southeast-2"*/

Instead, I am doing the following to work-around this issue, prior to
calling my producer.send command...

/*snsClient = (AmazonSNSClient)
exchange.getContext().getRegistry().lookup("snsClient");
snsClient.setEndpoint("http://sns.ap-southeast-2.amazonaws.com/"); */

Out of interest, I have also tried:

*Exchange exchange2 =
producer.send("aws-sns://TabcorpTopic?amazonSNSClient=#snsClient橦뎢璍䡉?袧=sns.ap-southeast-2.amazonaws.com"*/

... to no avail. Is there something I am missing with respect to this
value/parameter?

Lastly, I believe I am using 2.13-snapshot for my camel pom.xml file.

Please do let me know... Cheers,
Chris

Viewing all articles
Browse latest Browse all 5648

Trending Articles