I'm using Talend Open Studio for ESB (7.2.1) to create Apache Camel routes. Several routes are contained in one project, and also several beans for that routes.
Some routes share some beans and over time it can happen that a route becomes incompatible with the newest version of a bean - but also in a kind that the incompatibility shows up only at runtime and even only in a specific case.
So my question is: is it possible to specify the exact version of a bean (as all necessary versions are stored in the Talend project) that is referenced? I think that this could be possible in the cBean component, in the cBeanRegister component, in the Spring configuration or in the configuration of the route dependencies? - but didn't find any documentation or information on that.
My exact problem is this exception:
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations possible: [public static void beans.ArticleGroupHandler.handleGroup(org.apache.camel.Exchange), public static void beans.ArticleGroupHandler.handleNavisionGroups(org.apache.camel.Exchange)].
First only the public static void beans.ArticleGroupHandler.handleGroup(org.apache.camel.Exchange)
method existed in the bean and so my use of the cBean component without method specification worked. After an update in a different route, method public static void beans.ArticleGroupHandler.handleNavisionGroups(org.apache.camel.Exchange)
was added and a new build of the first route lead to the above exception during the execution.
I know that I can solve that exception by specifying the exact method to use, but want to know, if I could circumvent this kind of problem in the future by specifying the bean version.
Talend Bean versions is a matter of source version control. Think of it as tagged commits in a Git repository. You may use only a current version, which got compiled with your route as you build or publish it.
To support several versions of the same bean within an application, try copying it suffixed with a version number such as V1
, V2
etc. This will make all different versions accessible in classpath of a route and you'll be able to refer them as beans.MyBeanV1
, beans.MyBeanV2
etc.