camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias L√ľneberg <matthias.lueneb...@googlemail.com>
Subject Re: Camel Scala DSL and IntelliJ
Date Mon, 11 Feb 2013 16:05:14 GMT
Hi,

I think you don't need the "configure()" function/method. 

I think its okay to call "to" on the String, there is some implicit magic in between I think.

Look at here: http://camel.apache.org/scala-dsl-getting-started.html

The following worked for me in IntelliJ 12:

class SimpleRouter extends App {

def main(args : Array[String]) {

  val camelContext = new DefaultCamelContext()

  camelContext.addRoutes(new RouteBuilder() {

"file://Users/joe/Desktop/test.xml".to("file://Users/joe/Desktop/test1.xml")
    
  })

  camelContext.start()

  Thread.sleep(1000)

  camelContext.stop()
}
}

HTH,
Matthias

Am 11.02.2013 um 13:36 schrieb James Carman <jcarman@carmanconsulting.com>:

> How about from("file://...").to("file:///")
> 
> You're trying to call "to" on a java.lang.String literal object.
> 
> On Feb 11, 2013, at 5:30 AM, Joe San <codeintheopen@gmail.com> wrote:
> 
>> Guys,
>> 
>> I'm just trying a simple Scala DSL using intelli. I have a project created
>> and tried configuring a simple route as below:
>> 
>> class SimpleRouter extends App {
>> 
>> def main(args : Array[String]) {
>> 
>>   val camelContext = new DefaultCamelContext()
>> 
>>   camelContext.addRoutes(new RouteBuilder() {
>>     def configure() {
>> 
>> "file://Users/joe/Desktop/test.xml".to("file://Users/joe/Desktop/test1.xml")
>>     }
>>   })
>> 
>>   camelContext.start()
>> 
>>   Thread.sleep(1000)
>> 
>>   camelContext.stop()
>> 
>> }
>> 
>> }
>> 
>> But I get to see the following error when I tried to run the above route:
>> 
>> scala: value to is not a member of java.lang.String
>> 
>> "file://Users/joe/Desktop/test.xml".to("file://Users/joe/Desktop/test1.xml")
>> 
>> Any idea as to why the intellij would not recognize the dsl? Is there
>> anything that I have to do additionally?
>> 
>> Regards,
>> Joe
>>                                             ^
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message