Hi

I created an example which uses the Scala DSL. See the code comments
in the commit for explanation
http://svn.apache.org/viewvc?rev=1210988&view=rev

We should possible improve the documentation. I used the camel-test
kit for unit test as I think its powerful.
The Scala RouteBuilder -> Java RouteBuilder may be a way of getting
using implicit type converters, so there could
be a neater way of using the camel-test kit with Scala DSL RouteBuilder classes.

And you would get compiler error if you extend the RouteBuilder class
and do not implement  the configure method, as its abstract method.


On Tue, Nov 15, 2011 at 9:58 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:
> On Thu, Nov 10, 2011 at 2:06 PM, Kai Wähner <megachu...@googlemail.com> wrote:
>> Hello,
>>
>> I use Scala 2.9, Camel 2.8.2 and IntelliJ IDEA 10.5. All libraries are
>> imported via Maven. Other Scala stuff works well, thus Scala in IDEA seems
>> not to be the problem. I also can run a CamelStarter class which starts the
>> CamelContext successfully.
>>
>> I created a route:
>>
>> import org.apache.camel.scala.dsl.builder.RouteBuilder
>>
>> class FilterRoute extends RouteBuilder {
>>
>>  "direct:a" when (_.in == "kai") to("mock")
>>
>> }
>>
>> The "in" symbol cannot be found! (nevertheless code completion of IDEA
>> offers me "in" and a lot of other methods. Thus, I do not understand this
>> error.
>> "==" is also not found.
>>
>> If I create a class which extends RouteBuilder, but not containing any
>> route, then I got an error that some methods are not implemented. I went to
>> RouteBuilder.scala. Some compile error occur. Indeed, several methods are
>> not found, for example both wiretap-methode are in red color:
>>
>
> Do you get this from compiling on the command line, or from IDE? The IDE 
> support
> of Scala is still IMHO not so good, so the editors may report
> non-existing errors.
>
>
>
>>  def wireTap(uri: String) = stack.top.wireTap(uri)
>>  def wireTap(uri: String, expression: Exchange => Any) =
>> stack.top.wireTap(uri, expression)
>>
>> I am no Scala expert, so it is tough for me to follow all these traits,
>> implicit conversions, etc. in the Scala DSL.
>>
>> Can anybody assume what is wrong? Do I need another Camel, Scala or IDEA
>> version?
>> Is any specific library missing?
>>
>> Best regards,
>> Kai
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to