File consumer deletes file after processing first endpoint in multicast
Hi, all! Could you help me find a mistake in following case: file consumer with "delete=true" in options multicasts exchange to several destinations. But when exchange is processed in first destination, the file is being deleted, so the second can't get the File from GenericFile. Routes are: from("file://d:/buffer_in?recursive=true&delete=true") .multicast(new UseLatestAggregationStrategy()) .shareUnitOfWork() .to("direct:medo.file.test", "direct:medo.file.agregator") .end() .to("activemq:queue:medo.file.test2"); /** AFTER THIS AGREGATION THE FILE IS DELETED **/ from("direct:medo.file.agregator") .aggregate(header(MedoUtils.MH_FILE_CORRELATION), new FileAgregator()) .to("direct:next.agregator"); /** HERE THE FILE DOESN'T EXIST **/ from("direct:medo.file.test") .. and so on AFAIK, in this configuration the file should be deleted after completing all the routes, not only the first. System information: Java 1.6.0_31, Windows XP 32bit, Camel 2.8.5 (OSGI bundle in ServiceMix 4.4.2) Thank you! Serge. -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-deletes-file-after-processing-first-endpoint-in-multicast-tp5720510.html Sent from the Camel - Users mailing list archive at Nabble.com.
Catch NoSuchComponentException in org.apache.camel.impl.CompositeRegistry#lookup
Hi, all! I use Camel 2.10.3 in ServiceMix 4.5.0 Could someone please explain how to use org.apache.camel.impl.CompositeRegistry? I've got CamelContext, defined in bundle "A" and want to dynamically add to it a registry for resolving components from bundle "B". 1. I get the context's registry: Registry registry = camelContext().getRegistry(); if (registry instanceof org.apache.camel.impl.PropertyPlaceholderDelegateRegistry) registry = ((org.apache.camel.impl.PropertyPlaceholderDelegateRegistry)registry).getRegistry(); 2. create registry for current bundle: BlueprintContainerRegistry selfRegistry = new BlueprintContainerRegistry(blueprintContainer); 3. add selfRegistry to context's CompositeRegistry: if (registry instanceof org.apache.camel.impl.CompositeRegistry) { ((org.apache.camel.impl.CompositeRegistry)registry).addRegistry(selfRegistry); -- Now, what we have in composite registry: 1. OsgiServiceRegistry [for bundle A] 2. BlueprintContainerRegistry [for bundle A] 3. BlueprintContainerRegistry [for bundle B] - When trying to lookup component from bundle B I've got exception org.osgi.service.blueprint.container.NoSuchComponentException CompositeRegistry#lookup just lookups iterating the rigistries it has. And gets exception on the second one (BlueprintContainerRegistry [for bundle A]). 1. Am I using CompositeRegistry not in proper way? 2. If not, may be it's a bug and must be placed into the issue tracker? To fix it the exception must be caught in CompositeRegistry#lookup Thanks a lot! -- View this message in context: http://camel.465427.n5.nabble.com/Catch-NoSuchComponentException-in-org-apache-camel-impl-CompositeRegistry-lookup-tp5728645.html Sent from the Camel - Users mailing list archive at Nabble.com.