apache-camel

Camel first experience

拟墨画扇 提交于 2019-12-12 04:34:10
问题 I'm very new with Apache Camel. I can't get the simplest Camel example working. Here is the code: public class CamelFE { public static void main(String[] args) { CamelContext cc = new DefaultCamelContext(); cc.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { System.out.println("Go!"); from("file://Users/Foo/Desktop/IN") .to("file://Users/Foo/Desktop/OUT"); }); } cc.start(); cc.stop(); } Both directories exists, in the from one there is one simple file, helo

Using Saxon-PE with Apache Camel, Error Pre-Loading Saxon Classes

和自甴很熟 提交于 2019-12-12 04:19:02
问题 I have recently obtained a trial license for Saxon-PE and wish to use this version of Saxon within Camel. I downloaded the Saxon-PE-9.6.0.8 jars and have included them into my project via maven. I am using Camel 2.16.0. I have tried many approaches to this, but I have made the most headway by using Camel's "?transformerFactory=..." option and passing it Saxon's ProfessionalTransformerFactoryImpl, which is registered as a bean in my Spring config. When starting my application, the route

How to setup camel context and registry within java

半世苍凉 提交于 2019-12-12 04:18:11
问题 I am creating a stand alone camel application. I want to use only java (because the compiler tells whats wrong). To make my code less coupled and reusable by tests i want to decouple the creation of context and registry to separate classes. I just started to extend DefaultCamelContext - is this a good idea or should i extend/implement some other class? Within this class i want to use my own registry (it binds some bean instances) class. I found method setRegistry(org.apache.camel.spi.Registry

Cannot find data format in registry - Camel

时光怂恿深爱的人放手 提交于 2019-12-12 04:17:02
问题 I have a maven project, and I'm trying to marshal a file using jaxb and camel with the command: from("file://...").marshal("myDataFormat").to("file://..."); When I run the project, I get the following error: Cannot find data format in registry with ref: myDataFormat First, does anyone know what the "registry" is? I've searched Google, but can't find anything. I'm guessing it might be another name for the camel-context file. Second, how can I register a data format using camel? Is there a

Apache Camel 2.13.0 quit splitter

余生长醉 提交于 2019-12-12 04:08:31
问题 I have a route with splitter. I need to stop the splitting-job each time it occurs something. Naturally onCompletion can help me but: Regarding post "Apache Camel Loop does not stop on exception", it is a bug that if we use .onCompletion().onFailureOnly() .process(new MyStopRouteProcessor("routeName")) .end() the splitter does not stop splitting. I have to use 2.13.0 and have not any choice. How can I solve the problem? 回答1: Set the option stopOnException=true on the splitter as documented

Drools and Camel : Failed to load type converters Cannot find any type converter classes [org.drools.camel.component]

落花浮王杯 提交于 2019-12-12 04:07:08
问题 Can someone help me with the following exception. I'm using Apache Camel (2.10-SNAPSHOT) and Spring (3.0.7.RELEASE) with Tomcat (7.0.26). My Drools dependency in my pom.xml is <dependency> <groupId>org.drools</groupId> <artifactId>drools-camel</artifactId> <version>5.3.0.Final</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency> Exception on Tomcat log is - org.apache.camel.RuntimeCamelException: org

Springframework.jms.support.JmsAccessor does not have createConnection(userid,pwd) method

荒凉一梦 提交于 2019-12-12 04:05:58
问题 I am writing sample Apache Camel (2.16.2) application that connects to IBM MQ queue manager in clients mode. Apache Camel uses Spring JMS underneath to connect to JMS providers. I see that Spring JmsAccessor does not have a createConnection () method that takes UserId and Password. It only has createConnection () method that does not take any parameters. Because of this create connection to queue manager fails with 2035 - Not authorized. I can connect to queue manager in server bindings mode

Apache Camel context getting stopped automatically

☆樱花仙子☆ 提交于 2019-12-12 03:56:30
问题 I have a weird issue. Everything works perfectly when i run from IDE. Camel context gets stopped automatically when i run from console. What is causing the issue? Logs attached. 10:04:22.015 [Thread-3] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Found 3 packages with 16 @Converter classes to load 10:04:22.079 [Thread-3] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/C:/projects

Unable to get message in priority sequence Spring camel rabbitmq

落花浮王杯 提交于 2019-12-12 03:54:02
问题 I am a beginner in using spring camel rabbitmq . I am able to set message priority in message header by setting it in exchange out headers on the producer side, like this : exchange.getOut().setHeader("rabbitmq.PRIORITY", 1); BUT while consuming the messages they dont come in there order of priority. HELP !! I can see in web interface of rabbitmq that priority header in appropriately set 回答1: Please carefully read the "Interaction with consumers" section of this document. You should also

camel-file component filter with cdi

本秂侑毒 提交于 2019-12-12 03:46:34
问题 I'm using camel without the Spring framework (using CDI instead). How can I set a filter for the camel-file component? My filter class looks like this: @Named @Stateless public class MyFilter<T> implements GenericFileFilter<T> { System.out.println("MyFilter was triggered"); ....... So I tried this: <route> <from uri="file://somewhere?filter=#myFilter"/> <to uri="...."/> </route> But I'm getting: java.lang.IllegalArgumentException: Could not find a suitable setter for property: filter as there