RE: Fuse elasticsearch error
Yes dependency is added. Actually without dependency it will not even install the bundle. There we 2 other fixes which were required ie names.txt and changing elasticsearch version in a features file which I did. Issue is its not as is supported in Fuse 6.1 so that might be an issue. In camel it works fine. Thanks and Regards, Vanshul Chawla -Original Message- From: Reji Mathews [mailto:contactr...@gmail.com] Sent: Thursday, June 11, 2015 2:55 PM To: users@camel.apache.org Subject: Re: Fuse elasticsearch error Whats the version of camel you are using? Have you added the dependency in the POM.xml file. On Thu, Jun 11, 2015 at 9:11 AM, Vanshul.Chawla vanshul.cha...@target.com wrote: Hello, I am trying to do a simple POC on elastic search using Fuse. I have resolved errors for names.txt and snowball and my blueprint gets started. I am getting below error now: Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.index.codec.postingsformat.PostingFormats My route is camelContext id=elasticsearch xmlns=http://camel.apache.org/schema/blueprint; propertyPlaceholder id=properties5 location=blueprint:fuse-experian-sendemail-bundle-config5 / dataFormats xmljson id=xmljson / /dataFormats route from uri=file:src/in/elasticsearch / marshal ref=xmljson / convertBodyTo type=java.lang.byte[] charset=utf-16/ log message=Body inserted to elastic search is ${body}/ to uri=elasticsearch://local?operation=INDEXamp;indexName=mylogamp;indexType=data / log message=Index id from elastic search is ${body} and ${headers}/ /route /camelContext I am using an xml file, converting to json and then to byte array and then trying to insert in elastic search. Any clue if something is missing here? Thanks and Regards, Vanshul Chawla
Re: Fuse elasticsearch error
HI Vanshul Whats the camel version you are using? Jboss Fuse 6.0.0 supports only camel 2.10 and Fuse 6.1.0 supports camel 2.12. Hence knowing which camel version you are using will help us debug your issue. Also check if the maven jar has the package which it says its missing. I found that package only in the jar hosted at http://mvnrepository.com/artifact/org.elasticsearch/elasticsearch In worst case you can deploy this jar into ur deploy folder and write a dynamic import statement for that package in your maven-bundle plugin. Once deployed use following Karaf command to check if class is exported at contain level - *exports |grep org.elasticsearch.index.codec.postingsformat* If its present, then configure the maven-bundle-plugin jar as follows. Refer below plugin groupIdorg.apache.felix/groupId artifactIdmaven-bundle-plugin/artifactId version2.3.7/version extensionstrue/extensions configuration instructions Import-Packageorg.w3c.dom,org.tempuri.*,*/Import-Package DynamicImport-Package*org.elasticsearch.index.codec.postingsformat.** /DynamicImport-Package /instructions buildDirectorytarget/buildDirectory /configuration /plugin Cheers Reji On Thu, Jun 11, 2015 at 3:06 PM, Vanshul.Chawla vanshul.cha...@target.com wrote: Yes dependency is added. Actually without dependency it will not even install the bundle. There we 2 other fixes which were required ie names.txt and changing elasticsearch version in a features file which I did. Issue is its not as is supported in Fuse 6.1 so that might be an issue. In camel it works fine. Thanks and Regards, Vanshul Chawla -Original Message- From: Reji Mathews [mailto:contactr...@gmail.com] Sent: Thursday, June 11, 2015 2:55 PM To: users@camel.apache.org Subject: Re: Fuse elasticsearch error Whats the version of camel you are using? Have you added the dependency in the POM.xml file. On Thu, Jun 11, 2015 at 9:11 AM, Vanshul.Chawla vanshul.cha...@target.com wrote: Hello, I am trying to do a simple POC on elastic search using Fuse. I have resolved errors for names.txt and snowball and my blueprint gets started. I am getting below error now: Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.index.codec.postingsformat.PostingFormats My route is camelContext id=elasticsearch xmlns=http://camel.apache.org/schema/blueprint; propertyPlaceholder id=properties5 location=blueprint:fuse-experian-sendemail-bundle-config5 / dataFormats xmljson id=xmljson / /dataFormats route from uri=file:src/in/elasticsearch / marshal ref=xmljson / convertBodyTo type=java.lang.byte[] charset=utf-16/ log message=Body inserted to elastic search is ${body}/ to uri=elasticsearch://local?operation=INDEXamp;indexName=mylogamp;indexType=data / log message=Index id from elastic search is ${body} and ${headers}/ /route /camelContext I am using an xml file, converting to json and then to byte array and then trying to insert in elastic search. Any clue if something is missing here? Thanks and Regards, Vanshul Chawla
Re: Too many connection in TIME_WAIT when tempfilename is set in the FTP producer URI.
Hello Himanshu What version of camel do you use? There was a fix for leaked connection in case of auth failures, but this looks like another issue. Could you create JIRA ticket, attaching information about your route/endpoint URI? regards Grzegorz Grzybek 2015-06-11 13:02 GMT+02:00 Himanshu Mittal himanshu.mittal...@gmail.com: When we remove tempFileName from uri , FTP connections are not exhausted . -- View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768097.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Fuse elasticsearch error
Whats the version of camel you are using? Have you added the dependency in the POM.xml file. On Thu, Jun 11, 2015 at 9:11 AM, Vanshul.Chawla vanshul.cha...@target.com wrote: Hello, I am trying to do a simple POC on elastic search using Fuse. I have resolved errors for names.txt and snowball and my blueprint gets started. I am getting below error now: Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.index.codec.postingsformat.PostingFormats My route is camelContext id=elasticsearch xmlns=http://camel.apache.org/schema/blueprint; propertyPlaceholder id=properties5 location=blueprint:fuse-experian-sendemail-bundle-config5 / dataFormats xmljson id=xmljson / /dataFormats route from uri=file:src/in/elasticsearch / marshal ref=xmljson / convertBodyTo type=java.lang.byte[] charset=utf-16/ log message=Body inserted to elastic search is ${body}/ to uri=elasticsearch://local?operation=INDEXamp;indexName=mylogamp;indexType=data / log message=Index id from elastic search is ${body} and ${headers}/ /route /camelContext I am using an xml file, converting to json and then to byte array and then trying to insert in elastic search. Any clue if something is missing here? Thanks and Regards, Vanshul Chawla
Re: Too many connection in TIME_WAIT when tempfilename is set in the FTP producer URI.
When we remove tempFileName from uri , FTP connections are not exhausted . -- View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768097.html Sent from the Camel - Users mailing list archive at Nabble.com.
Tooling for Idea and Netbeans?
At today's (really great) Red Hat Microservices Architecture Developer Day in London [1] Claus Ibsen mentioned that there is now tooling support available for IntelliJ Idea and Netbeans as well as Eclipse (presumably what used to be Fuse IDE). If so this is awesone, but I can't find any info about this. Could someone provide further info? Sure it will be of interest to many. Tim [1] http://www.redhatonline.com/uk/seminar/microservices-architecture-developer-day/
Re: Trace from and to endpoints
I believe Camel tracks this automatically at the exchange level (assuming you are wanting this on a per-exchange basis). e.g. when you get an exception this information is written to the logs, so its already there. Try looking at the Exchange properties. Tim On 10/06/2015 16:51, rwijngaa wrote: Hi, What would be the best way to gather the 'path' a camel route takes for an audit log. The way i see it i have at least 3 options: implement my own Tracer (http://camel.apache.org/tracer.html), implement my own InterceptStrategy or catch the exchange events by extending the EventNotifierSupport? Thanks in advance Regards Rino -- View this message in context: http://camel.465427.n5.nabble.com/Trace-from-and-to-endpoints-tp5768077.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Too many connection in TIME_WAIT when tempfilename is set in the FTP producer URI.
Thanks I'll look at it soon regards Grzegorz 2015-06-11 14:41 GMT+02:00 Himanshu Mittal himanshu.mittal...@gmail.com: We faced this issue in *camel 2.12*. I tested the same with *camel 2.14* . Still I see connection being opened for each temp file. Created below JIRA for same CAMEL-8860 https://issues.apache.org/jira/browse/CAMEL-8860 -- View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768099.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Too many connection in TIME_WAIT when tempfilename is set in the FTP producer URI.
We faced this issue in *camel 2.12*. I tested the same with *camel 2.14* . Still I see connection being opened for each temp file. Created below JIRA for same CAMEL-8860 https://issues.apache.org/jira/browse/CAMEL-8860 -- View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768099.html Sent from the Camel - Users mailing list archive at Nabble.com.
PropertiesComponent overriding in Spring
Hi all, I'm migrating an application from Camel 2.14 to 2.15.2. I spent some time tracking a regression until I figured out that my custom properties (PropertiesComponent) spring bean was not taken anymore out of the Spring context no matter what I declared. After some more investigation, this seems to be caused by commit e34ee63cdb068b0bf7062bdb24446bddfc06ba66 that uses autoCreateComponents=false when querying the Camel context for the properties component. Having autoCreateComponents=false prevents the Camel context from looking it up from the Spring context,thus always returning null and constructing a default one. I must admit I don't get the rationale behind this change so pardon me if I'm missing something. Any advice to turn the documented feature back ? Thanks in advance, Vincent
ClassCastException in blueprint Route
Hi, I have a service component, deployed as a separate bundle, that exports a package, com.example.services.configuration, and a service that implements a ConfigurationService interface in another package called LocalService: com.example.services.configruation.ConfigurationService com.example.services.configruation.local.LocalConfigurationService Another bundle imports the service using a filter (from the blueprint XML): reference id=configurationService interface=com.castlighthealth.services.configuration.ConfigurationService filter=(realm=local)/ and sets it as a property on a route bean. When I start this second bundle in ServiceMix I am getting a stacktrace [1] and just can't seem to figure out what I am doing wrong. Any guidance is very much appreciated. John [1] 2015-06-11 21:59:41,641 | ERROR | Thread-58| BlueprintContainerImpl | ? ? | 7 - org.apache.aries.blueprint.core - 1.4.0 | Unable to start blueprint container for bundle my-process-router org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .camelBlueprint.factory.eventRouterContext at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714) at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824) at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787) at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79) at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_60-ea] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88) at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245) at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230) at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:145) at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:753) at org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:863) at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:528) at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:361) at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245) at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103) at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695) at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244) at org.apache.felix.framework.Felix.startBundle(Felix.java:1923) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931) at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:37) at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:37) at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[15:org.apache.karaf.shell.console:2.3.4] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[15:org.apache.karaf.shell.console:2.3.4] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[15:org.apache.karaf.shell.console:2.3.4] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[15:org.apache.karaf.shell.console:2.3.4] at
Having problems with CamelContext.addRoutes() and ActiveMQ
I am having problems getting queue data from CamelContext. I am a newbie to Camel and so I just don't see what I am doing wrong. I am using: Camel 2.15.2 ActiveMQ 5.11.1 I am using the following code to send data to the queue and it works (all of this is just test code to learn Camel). public static void putToEventQueue(String eventName, String eventStatus, String eventMessage) { init(); //Starts up ActiveMQ if it is not already started. CamelContext context = new DefaultCamelContext(); ProducerTemplate template = context.createProducerTemplate(); template.sendBody(vm://localhost:eventQueue, new EventMessage(eventName, eventStatus, eventMessage)); } If I use the following code to get data from ActiveMQ then it works (How I know that putToEventQueue is working). public void getFromQueue() { CamelContext context = new DefaultCamelContext(); ConsumerTemplate ct = context.createConsumerTemplate(); Object test = ct.receiveBody(vm://localhost:eventQueue); while (test != null) { System.out.println(consumer Name:+ ((EventMessage) test).getEventName()); System.out.println(consumer Message:+ ((EventMessage) test).getEventMessage()); test = ct.receiveBody(vm://localhost:eventQueue); } } But if I use the following CamelContext.addRoutes() code to get at the data it never retrieves any of the data from the queue. public void getFromQueue() { CamelContext context = new DefaultCamelContext(); context.addComponent(activemq, activeMQComponent(vm://localhost?broker.persistent=false)); try { context.addRoutes(new RouteBuilder() { public void configure() throws Exception { from(activemq:queue:eventQueue).to(browse:eventReceived); } }); context.start(); Thread.sleep(1); BrowsableEndpoint browse = context.getEndpoint(browse:eventReceived, BrowsableEndpoint.class); ListExchange exchanges = browse.getExchanges(); for (Exchange exchange : exchanges) { //If I set a break point here I never see data in exchanges. Object test = exchange.getIn().getBody(); System.out.println(consumer Name:+ ((EventMessage) test).getEventName()); System.out.println(consumer Message:+ ((EventMessage) test).getEventMessage()); } context.stop(); } catch (Exception e) { e.printStackTrace(); } } I have tried to look closely at the examples of using CamelContext to create a route from ActiveMQ but I am missing something in the mix because nothing ever makes it into the BrowsableEndpoint or exchanges from the ActiveMQ queue. Any suggestions in helping me to see what I am doing wrong is greatly appreciated.
Re: ClassCastException in blueprint Route
John, Would you be able to post how the service is being declared along with the service properties to ensure the correct service is being referenced in your consumer blueprint. Thanks, Andy -- Andrew Block On June 11, 2015 at 5:28:54 PM, John Dubchak (j...@johndubchak.com) wrote: Hi, I have a service component, deployed as a separate bundle, that exports a package, com.example.services.configuration, and a service that implements a ConfigurationService interface in another package called LocalService: com.example.services.configruation.ConfigurationService com.example.services.configruation.local.LocalConfigurationService Another bundle imports the service using a filter (from the blueprint XML): reference id=configurationService interface=com.castlighthealth.services.configuration.ConfigurationService filter=(realm=local)/ and sets it as a property on a route bean. When I start this second bundle in ServiceMix I am getting a stacktrace [1] and just can't seem to figure out what I am doing wrong. Any guidance is very much appreciated. John [1] 2015-06-11 21:59:41,641 | ERROR | Thread-58 | BlueprintContainerImpl | ? ? | 7 - org.apache.aries.blueprint.core - 1.4.0 | Unable to start blueprint container for bundle my-process-router org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .camelBlueprint.factory.eventRouterContext at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714) at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824) at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787) at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79) at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_60-ea] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88) at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245) at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230) at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:145) at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:753) at org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:863) at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:528) at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:361) at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245) at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103) at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695) at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244) at org.apache.felix.framework.Felix.startBundle(Felix.java:1923) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931) at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:37) at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:37) at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[15:org.apache.karaf.shell.console:2.3.4] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[15:org.apache.karaf.shell.console:2.3.4] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[15:org.apache.karaf.shell.console:2.3.4] at
using basic auth to protect camel rest dsl routes
Hi folks, After banging my head for a bit, I wrote a blog post about using basic auth to protect rest dsl routes served using jetty: http://www.mooreds.com/wordpress/archives/2065 Would love any feedback. Thanks, Dan
Re: Too many connection in TIME_WAIT when tempfilename is set in the FTP producer URI.
Temporary file name (Camel property : tempFileName )is creating new connection for each file transfer. -- View this message in context: http://camel.465427.n5.nabble.com/Too-many-connection-in-TIME-WAIT-when-tempfilename-is-set-in-the-FTP-producer-URI-tp5768017p5768121.html Sent from the Camel - Users mailing list archive at Nabble.com.
Proper way to rollback database calls and send to error queue
Hi, One could think having an inner transaction would be easy. My StoreDataBean makes several database calls and all needs to be inside one transaction. If one of they fail they should all be rollbacked and sent to the errorQueue. onException(Exception.class).handled(true).to(errorQueue); from(inQueue) .transacted() .to(direct:a) ; from(direct:a) .onException(Exception.class).handled(false).markRollbackOnlyLast().end() .transacted(PROPAGATION_REQUIRES_NEW) .bean(new StoreDataBean()) // making several database calls ; But it doesn't work. What I do get working is the following, but I think its the wrong way: from(inQueue) .transacted() .setHeader(storeData, constant(false)) .to(direct:a) .choice().when(header(storeData).isEqualTo(false)) .log(Sending message to errorQueue) .to(errorQueue) ; from(direct:a) .transacted(PROPAGATION_REQUIRES_NEW) .bean(new StoreData()) // making several database calls, setting header to true if all successfull .choice().when(header(storeData).isEqualTo(false)) .log(Stored data to database failed, rollbacking) .markRollbackOnlyLast() .otherwise() .log(Stored data to database successfully) .end() ; Or is there another way? -- View this message in context: http://camel.465427.n5.nabble.com/Proper-way-to-rollback-database-calls-and-send-to-error-queue-tp5768092.html Sent from the Camel - Users mailing list archive at Nabble.com.