camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shane MacPhillamy <>
Subject Re: Starting to use AWS-SNS Camel component in Spring
Date Tue, 27 Jan 2015 07:46:25 GMT
Thank you for your reply Claus. As I said in my post I'm quite new to Spring and Camel and
yes there are a lot of pages on the Internet about Spring, all quite a opaque to a new comer.

I want to be able to configure the amazonSNSClient at run time, if I follow your example I
would be configuring the client at packaging time, which isn't what I want to do.

It would be helpful, not only to me, but I'm sure to others, to offer a snippet that gave
some indication of the key camelContext pieces that would need to be set to create the client
and set the AWS credentials. 

Cheers, Shane

> On 27 Jan 2015, at 6:04 pm, Claus Ibsen <> wrote:
> Hi
> You can define beans in spring xml file, where you can configure the
> client just as the example does in java code.
> <bean id="someName" class="">
>  <property name="proxyHost" value="..."/>
>   ..
> </bean>
> And you can refer to other beans. Its standard spring xml syntax, so
> you can find plenty of documentation on the internet
>> On Tue, Jan 27, 2015 at 4:12 AM, Shane MacPhillamy <> wrote:
>> I’m pretty new to Spring configuration and Camel. I’ve started with an example
from the Camel tarball and modified it to use the “awd-sns” URI. Specifying all parameters
on the the URI I can successfully create and post to an SNS topic.
>> I would like to store the AWS credentials and endpoint in the ApplicationContextRegistry
at run-time and reference the configuration via amazonSNSClient# in the “aws-sns” URI
as described here <>.
The provided example:
>> AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey");
>> ClientConfiguration clientConfiguration = new ClientConfiguration();
>> clientConfiguration.setProxyHost("http://myProxyHost");
>> clientConfiguration.setProxyPort(8080);
>> AmazonSNS client = new AmazonSNSClient(awsCredentials, clientConfiguration);
>> registry.bind("client", client);
>> Uses the bind method to store the client details in the registry, from what I can
work out the bind method is only applicable JndiRegistry not ApplicationContextRegistry.
>> My spring/camel-context.xml file is pretty basic and looks like this:
>> <beans xmlns=""
>>       xmlns:xsi=""
>>       xmlns:context=""
>>       xsi:schemaLocation="
>>  <!-- first, define your individual @Configuration classes as beans -->
>>  <bean class="org.apache.camel.example.spring.javaconfig.MyRouteConfig"/>
>>  <!-- be sure the configure class to be processed -->
>>  <context:annotation-config/>
>> </beans>
>> Where could I find pointers to the pieces needed to configure Spring so that I can
create and modify the clientConfiguration at run-time?
>> Thanks.
>> Cheers, Shane
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email:
> Twitter: davsclaus
> Blog:
> Author of Camel in Action:
> hawtio:
> fabric8:

View raw message