ended up compiling kafka client 0.7.2 with scala 2.10, was not hard, everything works.
using multiple war's to resolve multiple scala versions
-
14-07-2023 - |
Вопрос
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:
- Download sources of
0.7.2
kafka client and compile with scala2.10
unfortunately too many changes in sources to perform. - Use
jarajar
and updatescala-library.jar
to have a prefix in packaging something likescala.* -> scala.29.*
, Then update kafka client 0.7.2 to import classes fromscala.29.*
I tried that and also had problems here. - 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 originalwar
to from mywar1
towar2
andwar2
will be a simple web app which will hold a simplekafka 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?
Решение
Не связан с StackOverflow