Created
March 18, 2011 13:53
-
-
Save cyberzac/876095 to your computer and use it in GitHub Desktop.
Apache Camel RouteBuilder in the Scala DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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