Search code examples
apache-camelakkatypesafe

akka-camel: setting URI endpoint in application.conf?


I have an Akka actor that extends camel's UntypedConsumerActor. I want to provide the value of its endpoint URI in application.conf instead of hard-coding, since the URI will be different in Dev, Test, and Production environment. I like to do this with pure typesafe config and don't have to bother with wiring in Spring. A sample application.conf would be great.


Solution

  • You can read config property from the UntypedConsumerActor with something like:

    this.uri = getContext().system().settings().config().getString("myendpoint-uri");
    

    and in your application.conf define:

    myendpoint-uri = "mina2:tcp://localhost:6200?textline=true"