14 setembro 2012

Customizing Camel components within Scala DSL

Even though I joined Oracle last July, I continue to have fun with some of other technologies, like the Scala language. And as I used to evangelize the Apache Camel framework in Brazil, I think I still owe some things to the Open Source community.

In a few weeks, I will be at JavaOne to talk about Apache Camel and the Camel Twitter component that I contributed, together with Brett Meyer, months ago. So while developing the demo, I found a small issue with the Camel Scala DSL that couldn't find anywhere else.

How to customize components within the Scala DSL for Apache Camel?
It happens that, using Java DSL, you can customize components simply like this:

But using Scala DSL, does that really work?

Not really... If you try this, the Camel Twitter component will throw an error saying that no token was provided for authentication. So here is how you make it work:

Hope this helps you some day! And you are welcome to attend my session "Leverage Enterprise Integration Patterns with Apache Camel and Twitter", at JavaOne 2012!
Postar um comentário


LinkedIn: www.linkedin.com/in/brunocborges
Twitter: www.twitter.com/brunoborges
Comprei e Não Vou
Rio de Janeiro, RJ Brasil
São Paulo, SP Brasil