camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdfleischmann <cdfleischm...@gmail.com>
Subject AWS SNS + Camel + "amazonSNSEndpoint" being ignored?
Date Wed, 12 Mar 2014 00:08:13 GMT
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&amazonSNSEndpoint=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&amazonSNSEndpoint=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



--
View this message in context: http://camel.465427.n5.nabble.com/AWS-SNS-Camel-amazonSNSEndpoint-being-ignored-tp5748651.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message