[CONF] Apache Camel > Quartz2
Carsten Ringe bearbeitete die Seite: Quartz2 ... For example, the following routing rule will fire two timer events to the mock:results endpoint: Codeblock language java from("quartz2://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result"); ... Online anzeigen · Gefällt mir · Änderungen anzeigen Überwachung des Bereichs beenden · Benachrichtigungen verwalten Diese Nachricht wurde von Atlassian Confluence 5.0.3, der Kollaborationssoftware für Teams, gesendet
[CONF] Apache Camel > Camel Maven Plugin
Carsten Ringe bearbeitete die Seite: Camel Maven Plugin Kommentar: Try to fix syntaxhighlighting ... Hinweis You may override the default Spring application context file uri META-INF/spring/*.xml by using the applicationContextUri property in the camel-maven-plugin configuration. Paths may be split using a semi-colon (;). Codeblock langlanguage xml org.apache.camel camel-maven-plugin META-INF/spring/*.xml;YOUR_FILE_NAME_IN_THE_CLASS_PATH.xml You can also specify what Main class to use when running the plugin. By default this is org.apache.camel.spring.Main. Codeblock lang
[CONF] Apache Camel > Transactional Client
Carsten Ringe bearbeitete die Seite: Transactional Client Kommentar: formatting and syntax highlight ... You first define needed object in the spring configuration. Codeblock xml Then you look them up and use them to create the JmsComponent. Codeblock language java PlatformTransactionManager transactionManager = (PlatformTransactionManager) spring.getBean("jmsTransactionManager"); ConnectionFactory connectionFactory = (ConnectionFactory) spring.getBean("jmsConnectionFactory"); JmsComponent component = JmsComponent.jmsComponentTransacted(connectionFactory, transactionManager); component.getConfiguration().setConcurrentConsumers(1); ctx.addComponent("activemq", componen
[CONF] Apache Camel > XStream
Carsten Ringe bearbeitete die Seite: XStream Kommentar: add headline above codeblock ... Codeblock language xml org.apache.camel camel-xstream x.x.x Using the Java DSL Codeblock // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().xstream(). to("mqseries:Another.Queue"); ... Online anzeigen · Gefällt mir · Änderungen anzeigen Überwachung des Bereichs beenden · Benachrichtigungen verwalten Diese Nachricht wurde von Atlassian Confluence 5.0.3, der Kollaborationssoftware für Teams, gesendet
[CONF] Apache Camel > XStream
Carsten Ringe bearbeitete die Seite: XStream Kommentar: move maven dependency to the top, like other pages ... XStream is a Data Format which uses the XStream library to marshal and unmarshal Java objects to and from XML. To use XStream in your camel routes you need to add the a dependency on camel-xstream which implements this data format. Maven users will need to add the following dependency to their pom.xml for this component: Codeblock language xml org.apache.camel camel-xstream x.x.x Codeblock // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().xstream(). to("mqseries:Another.Queue"); ... From Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key Exchange.CHARSET_NAME, or setting the encoding property on Xstream from DSL or Spring config. Codeblock
[CONF] Apache Camel > JPA
Carsten Ringe bearbeitete die Seite: JPA Kommentar: fix typo ... Codeblock xml messageIdcamel:header> ... Online anzeigen · Gefällt mir · Änderungen anzeigen Überwachung des Bereichs beenden · Benachrichtigungen verwalten Diese Nachricht wurde von Atlassian Confluence 5.0.3, der Kollaborationssoftware für Teams, gesendet
[CONF] Apache Camel > CronScheduledRoutePolicy
Carsten Ringe bearbeitete die Seite: CronScheduledRoutePolicy Kommentar: added a short example for the new CronScheduledRoutePolicy in quartz2 ... Maven users will need to add a camel-quartz dependency to their pom.xml to avail this capability. Codeblock xml org.apache.camel camel-quartz x.x.x ... Tipp title Relationship to the [Quartz2] component From Camel 2.12.2 onwards you can also make use of the Quartz2 based implementation of this route policy.
[CONF] Apache Camel > Simple
Simple Page edited by Carsten Ringe Kommentar: Setting Spring beans to Exchange properties Changes (1) ... {code} h3. Setting Spring beans to Exchange properties *Available as of Camel 2.6* You can set a spring bean into an exchange property as shown below: {code:xml} ......ref:myBeanId ... {code} h3. Dependencies The [Simple] language is part of *camel-core*. Full Content Simple _expression_ Language The Simple _expression_ Language was a really simple language you can use, but has since grown more powerful. Its primarily intended for being a really small and simple language for evaluating _expression_ and Predicate without requiring any new dependencies or knowledge of XPath; so its ideal for testing in camel-core. Its ideal to cover 95% of the common use cases when you need a little bit of _expression_ based script in your Camel routes. However for much more complex use cases you are generally recommended to choose a more expressive and powerful language such as: SpEL Mvel Groovy _javascript_ EL OGNL one of the supported Scripting Languages The simple language uses ${body} placeholders for complex expressions where the _expression_ contains constant literals. The ${ } placeholders can be omitted if the _expression_ is only the token itself. Alternative syntaxFrom Camel 2.5 onwards you can also use the alternative syntax which uses $simple{ } as placeholders. This can be used in situations to avoid clashes when using for example Spring property placeholder together with Camel. Configuring result typeFrom Camel 2.8 onwards you can configure the result type of the Simple _expression_. For example to set the type as a java.lang.Boolean or a java.lang.Integer etc. File language is now merged with Simple languageFrom Camel 2.2 onwards, the File Language is now merged with Simple language which means you can use all the file syntax directly within the simple language. Simple Language Changes in Camel 2.9 onwardsThe Simple language have been improved from Camel 2.9 onwards to use a better syntax parser, which can do index precise error messages, so you know exactly what is wrong and where the problem is. For example if you have made a typo in one of the operators, then previously the parser would not be able to detect this, and cause the evaluation to be true. There is a few changes in the syntax which are no longer backwards compatible. When using Simple language as a Predicate then the literal text must be enclosed in either single or double quotes. For example: "${body} == 'Camel'". Notice how we have single quotes around the literal. The old style of using "body" and "header.foo" to refer to the message body and header is @deprecated, and its encouraged to always use ${ } tokens for the built-in functions. The range operator now requires the range to be in single quote as well as shown: "${header.zip} between '3..3'". To get the body of the in message: "body", or "in.body" or "${body}". A complex _expression_ must use ${ } placeholders, such as: "Hello ${in.header.name} how are you?". You can have multiple functions in the same _expression_: "Hello ${in.header.name} this is ${in.header.me} speaking". However you can not nest functions in Camel 2.8.x or older (i.e. having another ${ } placeholder in an existing, is not allowed). >From Camel 2.9 onwards you can nest functions. Variables Variable Type Description camelId String Camel 2.10: the CamelContext name camelContext.OGNL Object Camel 2.11: the CamelContext invoked using a Camel OGNL _expression_. exchangeId String Camel 2.3: the exchange id id String the input message id body Object the input body in.body Object the input body body.OGNL Object Camel 2.3: the input body invoked using a Camel OGNL _expression_. in.body.OGNL Object Camel 2.3: the input body invoked using a Camel OGNL _expression_. bodyAs(type) Type Camel 2.3: Converts the body to the given type determined by its classname. The converted body can be null. mandatoryBodyAs(type) Type Camel 2.5: Converts the body to the given type determined by its classname, and expects the body to be not null. out.body Object the output body header.foo Object refer to the input foo header header[foo] Object Camel 2.9.2: refer to the input foo header headers.foo Object refer to the input foo header headers[foo] Object Camel 2.9.2: refer to the input foo header in.header.foo Object refer to the input foo header in.header[foo] Object Camel 2.9.2: refer to the input foo header in.headers.foo Object refer to the input foo
[CONF] Apache Camel > Set up your IDE
Set up your IDE Page added by Carsten Ringe Import settings and templates Eclipse Install the checkstyle plugin via the Eclipse Marketplace Import checkstyle settings from etc/buildtools/src/main/resources/camel-checkstyle.xml Import the formatter from etc/eclipse/CamelCodeFormatter.xml Import code templates from etc/eclipse/camel_java_templates.xml, etc/eclipse/camel_xml_templates.xml, etc/eclipse/codetemplates.xml IntelliJ IDEA Import settings from etc/idea/settings.jar Stop watching space | Change email notification preferences View Online
[CONF] Apache Camel > Code Walkthrough
Code Walkthrough Page edited by Carsten Ringe Kommentar: Change link into sourcecode to use git repo Changes (1) ... The main module to get to grips with is the [camel-core|http://camel.apache.org/maven/current/camel-core/apidocs/index.html] module which defines the core APIs and the [DSL]. Often developers pick up libraries by looking at test cases. Probably the best test cases to start with are the [processor test cases|http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/] cases|https://git-wip-us.apache.org/repos/asf?p=camel.git;a=tree;f=camel-core/src/test/java/org/apache/camel/processor] Full Content Code Walkthrough The main module to get to grips with is the camel-core module which defines the core APIs and the DSL. Often developers pick up libraries by looking at test cases. Probably the best test cases to start with are the processor test cases Stop watching space | Change email notification preferences View Online | View Changes
[CONF] Apache Camel > camel-jboss
camel-jboss Page edited by Carsten Ringe Kommentar: Fixed package names for JBossPackageScanClassResolver - my first edit on camel docs Changes (2) ... {info} The resolver is provided in the class {{org.apacheextras.camel.jboss.JBossPackageScanClassResolver}} in the {{camel-jboss}} jar file. {info:title=Camel 2.8 onwards} ... {code:xml} class="org.apacheextras.camel.jboss.JBossPackageScanClassResolver"/> ... Full Content camel-jboss Available as of Camel 2.1 The camel-jboss is a component which allows you to run Camel inside JBoss Application Server. This component is needed due JBoss classloading challenges. The component is a specialized Camel Pluggable Class Resolvers to remedy this. JBoss versionIf you are using JBoss 4.x/5.x then you need to use camel-jboss JAR. If you are using JBoss 6.x then you need to use camel-jboss6 JAR. The resolver is provided in the class org.apacheextras.camel.jboss.JBossPackageScanClassResolver in the camel-jboss jar file. Camel 2.8 onwardsFrom Camel 2.8 onwards there is no longer the need for using this camel-jboss component as Camel is now capable of loading type converters without package scanning. This requires though that all 3rd party components with type converter must define the name of the converter classes as FQN in the META-INF/org/apache/camel/TypeConverter file. See more details at Type Converter. One exception is if you are using Bindy component as it still needs this JBoss resolver. Using with Java DSL You need to configure the resolver on the CamelContext which is done like this: PackageScanClassResolver jbossResolver = new JBossPackageScanClassResolver(); CamelContext context = new DefaultCamelContext(); context.setPackageScanClassResolver(jbossResolver); Using with Spring XML When using Spring XML its just a matter of defining a spring bean with the JBoss class resolver as shown: The Camel Extra project was moved to an official associated Apache site and as part of the migration the package names in the source code must not use org.apache so we renamed the packages as shown above. But if you are using the older versions of the JAR files then you need to use as shown below: Dependencies You need to get the component from the Camel Extra project as JBoss uses LPGL license which cannot be hosted at Apache. Stop watching space | Change email notification preferences View Online | View Changes