Question

I know that there is a supported Scala DSL for Camel. Apart from that

  • Is it realistic to replace Java (the language) completely by Scala for a Camel based project?

  • Which kind of known problems are known to exist?

  • Which workarounds exist for those problems (other than using Java)?

I am mainly looking for less boilerplaty code.

Was it helpful?

Solution

Akka offers stable Scala-idiomatic Camel integration.

The akka-camel module allows actors, untyped actors and typed actors to receive and send messages over a great variety of protocols and APIs. This section gives a brief overview of the general ideas behind the akka-camel module, the remaining sections go into the details. In addition to the native Scala and Java actor API, actors can now exchange messages with other systems over large number of protcols and APIs such as HTTP, SOAP, TCP, FTP, SMTP or JMS, to mention a few. At the moment, approximately 80 protocols and APIs are supported.

Apart from that, I'm sure this replacement is possible due to a good interop, and there could hardly be any Scala-specific issues that are not peculiar to Java. E.g., Akka Actors used for publishing to/consuming from Camel endpoints are based on java.util.concurrency, and the only problem I can think of is a fixable bug in the library.

OTHER TIPS

In the meantime a relatively simple Scala DSL has been developed for Camel, that should have the functionality of the Java DSL.

To decide if it is realistic for you, consider:
- The quality of the IDE support for the languages
- The Scala language complexity
- The Scala/Java language popularity
- DSL extension possibilities. In Scala, it should be possible (with some Scala magic) to to extend the DSL (add additional DSL elements)

If you decide to try it out, it would be great if you share your experience with the Apache Camel community your impressions on: code readability, code maintainability, code efficiency, developer satisfaction, code size, the number of "man-days".

Since then (2010-2011), there is now (Sept 2016) a recent initiative named for Akka Streams Integration, codename Alpakka.

We believe that Akka Streams can be the tool for building a modern alternative to Apache Camel. That will not happen by itself overnight and this is a call for arms for the community to join us on this mission. The biggest asset of Camel is its rich set of endpoint components. We would like to see that similar endpoints are developed for Akka Streams.

See "akka/akka-stream-contrib".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top