Skip to content

Instantly share code, notes, and snippets.

@cyberzac
Created March 18, 2011 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberzac/876094 to your computer and use it in GitHub Desktop.
Save cyberzac/876094 to your computer and use it in GitHub Desktop.
Apache Camel RouteBuilder in the Scala DSL
def createRouteBuilder(minaPort: Int, xmppAddress: String): ScalaRouteBuilder = new ScalaRouteBuilder {
val xmpp = "xmpp://" + xmppAddress
val mina = "mina:tcp://localhost:%s?textline=true&sync=true&encoding=UTF-8".format(minaPort)
mina process((exchange:Exchange) => {
val translated = chainedTranslator.translate(exchange.in.toString)
exchange.out = translated
})
xmpp bean(chainedTranslator) to xmpp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment