Hi all, We're finding ourselves duplicating logic in our talend routes for common operations. So, we're planning on refactoring out this logic into their own routes that we can then call using direct-vm. This works fine in the OSGI container, but to facilitate development it'd be great if this worked in the studio too, otherwise we'll need to deploy to the container to test which would make our debug cycles longer. I see that 5.4 will support direct-vm "in the studio", but its this just a component that generates a "direct-vm" consumer/producer that needs to be run in the container or will be able to actually run and test routes that use direct-vm in the studio?
Yes, we have a cDirectVM (direct-vm:// endpoint) component in Talend ESB 5.4. Your point was more if you can test Routes with Direct VM in studio. Here the answer is yes, if the routes are in one 'Route Builder Job' (one diagram) but no, if they are in different 'Route Builder Jobs (different diagrams). In our studio we start a new Java-Process whenever you click on 'Run' and direct-vm requires to run in the same JVM which is not the case in this scenario. Dietmar
Thanks for the reply. The reason we want to use "direct-vm" is so that we can factor out common route logic into their own standalone routes that can then be used by multiple routes without having to copy and paste from one route to another. Basically, if I have Route A and Route B (in separate diagrams) I'd like for them both to be able to use Route C (also in it's own diagram). It sounds like this isn't possible to test in the studio and if we take this approach we're adding deploying to Karaf to our debug cycle. Is there a better way in Talend to develop re-usable route logic or is this the best approach?
Hi, This issue is quite old now, but I am running into the same trouble now : with TOS ESB 6.1 I am not able to use direct-vm when not in the same "route builder". Are there any solutions, other than deploying to the runtime, for testing our routes ? Thanks.
Hello Apparently it works the same in the container (TESB 5.6.2) - the direct endpoint is accessible only inside the same Camel context (or - the same bundle). To leverage the local transport we had to use the "vm" endpoint working across the whole JVM (across bundles and contexts) And inside the TOS - you have to have the mediation route started to be accessible - and only a single route is started in the same JVM, so you cannot use the direct/vm from the TOS :/ g.
To elaborate a little bit on Gabriel's point. There are three similar endpoints in Camel: direct, vm, and direct-vm. All of these endpoints work only within the same JVM. When you run a route in Studio it runs in its own JVM. If you run another route in Studio, it starts another JVM. So none of these endpoints will work in Studio for communication between routes. Things are different if you run routes in the Karaf container. In that case everything is of course running in the same JVM (i.e. Karaf). But Direct only works for communication within the same Camel Context. So it will not work even in Karaf for communication between Talend Studio "routes". Camel VM will work between Camel contexts as long as they are in the same JVM. But VM uses SEDA so you cannot have transactions spanning communication that use VM endpoints. For that use case you have direct-vm. Direct-vm allows communication between Camel contexts as long as they are in the same JVM. And since as the name implies it is direct you can have a transaction spanning the direct-vm communication. Hope this helps.