Question

I normally use scala 2.10.x. Due to some limitation of the components which i have no control over, I have to use kafka client version 0.7.2 However this version of kakfa can be compiled only with scala ver 2.9.2 and does not work with scala 2.10. note: I can't use the newer versions of kafka, its not working, i have no control over actual kafka version so i must use this client version. so i must use kafka client 0.7.2

So I had multiple options:

  1. Download sources of 0.7.2 kafka client and compile with scala 2.10 unfortunately too many changes in sources to perform.
  2. Use jarajar and update scala-library.jar to have a prefix in packaging something like scala.* -> scala.29.*, Then update kafka client 0.7.2 to import classes from scala.29.* I tried that and also had problems here.
  3. This is what i'm going to do now - create another .war in my tomcat web server, as tomcat will load different wars with different classloaders, I can send my kafka requests instead of from my original war to from my war1 to war2 and war2 will be a simple web app which will hold a simple kafka client 0.7.2.

My question : Does option 3 sounds wise? I have some thoughts about its overhead, if I send GET requests to localhost just because I have multiple wars to resolve having multiple classloaders issues how good/bad is that?

Was it helpful?

Solution

ended up compiling kafka client 0.7.2 with scala 2.10, was not hard, everything works.

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