Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there known problems using Scala with Apache Camel?

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.

like image 379
mkneissl Avatar asked Nov 04 '10 16:11

mkneissl


People also ask

Is Apache Camel outdated?

It's especially suited to application integration – that means it's good if you need to consume, transform and route data between applications. Apache Camel is even more relevant today in the cloud era, where the number of applications in a typical enterprise just seems to be growing bigger and bigger.

Which open source framework does Apache Camel use?

Apache Camel is such an EAI framework, which is developed around enterprise integration patterns. It provides a decent list of pre-packaged components for accessing various backend systems and leverages a very extensible overall architecture.

Why do we need Apache Camel?

Apache Camel is an open source integration framework designed to make integrating systems simple and easy. It allows end users to integrate various systems using the same API, providing support for multiple protocols and data types, while being extensible and allowing the introduction of custom protocols.


2 Answers

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.

like image 86
Vasil Remeniuk Avatar answered Sep 30 '22 17:09

Vasil Remeniuk


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".

like image 44
i000174 Avatar answered Sep 30 '22 17:09

i000174