This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 79b654092f45daee3a25928c8731564668eb519f Author: Claus Ibsen <[email protected]> AuthorDate: Mon Nov 1 19:19:59 2021 +0100 CAMEL-16861: Cleanup docs --- .../main/docs/modules/eips/pages/marshal-eip.adoc | 2 + .../docs/modules/eips/pages/unmarshal-eip.adoc | 2 + .../assets/images/images/MessageTranslator.gif | Bin 0 -> 2183 bytes .../ROOT/pages/cronscheduledroutepolicy.adoc | 40 +++++---- .../modules/ROOT/pages/data-format.adoc | 99 +++------------------ 5 files changed, 39 insertions(+), 104 deletions(-) diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/marshal-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/marshal-eip.adoc index 74a1f90..ac71cab 100644 --- a/core/camel-core-engine/src/main/docs/modules/eips/pages/marshal-eip.adoc +++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/marshal-eip.adoc @@ -3,6 +3,8 @@ The xref:marshal-eip.adoc[Marshal] and xref:unmarshal-eip.adoc[Unmarshal] EIPs are used for xref:message-translator.adoc[Message Transformation]. +image::eip/MessageTranslator.gif[image] + Camel has support for message transformation using several techniques. One such technique is xref:components:dataformats:index.adoc[Data Formats], where marshal and unmarshal comes from. diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/unmarshal-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/unmarshal-eip.adoc index 988105b..044874c 100644 --- a/core/camel-core-engine/src/main/docs/modules/eips/pages/unmarshal-eip.adoc +++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/unmarshal-eip.adoc @@ -3,6 +3,8 @@ The xref:marshal-eip.adoc[Marshal] and xref:unmarshal-eip.adoc[Unmarshal] EIPs are used for xref:message-translator.adoc[Message Transformation]. +image::eip/MessageTranslator.gif[image] + Camel has support for message transformation using several techniques. One such technique is xref:dataformats:index.adoc[Data Formats], where marshal and unmarshal comes from. diff --git a/docs/user-manual/modules/ROOT/assets/images/images/MessageTranslator.gif b/docs/user-manual/modules/ROOT/assets/images/images/MessageTranslator.gif new file mode 100644 index 0000000..f2d52fe Binary files /dev/null and b/docs/user-manual/modules/ROOT/assets/images/images/MessageTranslator.gif differ diff --git a/docs/user-manual/modules/ROOT/pages/cronscheduledroutepolicy.adoc b/docs/user-manual/modules/ROOT/pages/cronscheduledroutepolicy.adoc index bfeae23..b7525d5 100644 --- a/docs/user-manual/modules/ROOT/pages/cronscheduledroutepolicy.adoc +++ b/docs/user-manual/modules/ROOT/pages/cronscheduledroutepolicy.adoc @@ -3,26 +3,13 @@ `CronScheduledRoutePolicy` is a xref:scheduledroutepolicy.adoc[ScheduledRoutePolicy] that facilitates route activation, de-activation, suspension and resumption of routes -based on a xref:components::quartz-component.adoc[Quartz] `CronTrigger`. - -Maven users will need to add a camel-quartz dependency to their -`pom.xml` to avail this capability. - -[source,xml] ----- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-quartz</artifactId> - <version>x.x.x</version> - <!-- use the same version as your Camel core version --> -</dependency> ----- +based on a xref:components::quartz-component.adoc[Quartz] cron trigger. [TIP] ==== .Relationship to the Quartz component -All Scheduled route policies share the scheduler created by the Quartz +All Scheduled route policies share the scheduler created by the xref:components::quartz-component.adoc[Quartz] component. In this way, scheduler, jobs and triggers can be managed in a common and consistent way. ==== @@ -53,7 +40,7 @@ Cron Expression for route start |routeStopTime |String | |the initial scheduled Date and time as a Cron Expression for route stop -|routeStopGracePeriod |int |10 seconds |the time period to wait before +|routeStopGracePeriod |int |10000 |the time period to wait before initiating graceful route stop |routeStopTimeUnit |long |TimeUnit.MILLISECONDS |the time unit for the @@ -78,10 +65,10 @@ Cron Expression for route suspension Cron Expression for route resumption |======================================================================= -== Configuring the policy +== Configuring the route policy Once the `org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy` -is created it can be wired into the camel route as follows: +is created it can be wired into the Camel route as follows: In Java: @@ -113,4 +100,19 @@ And with Spring XML: IMPORTANT: Notice how the route to be scheduled *MUST* be configured to not xref:configuring-route-startup-ordering-and-autostartup.adoc[autostartup], to let -the route scheduler take control of starting and stopping the route accordingly. \ No newline at end of file +the route scheduler take control of starting and stopping the route accordingly. + +=== Dependency + +Maven users will need to add a camel-quartz dependency to their +`pom.xml` to avail this capability. + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-quartz</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +---- diff --git a/docs/user-manual/modules/ROOT/pages/data-format.adoc b/docs/user-manual/modules/ROOT/pages/data-format.adoc index 7d7558f..a0f2c75 100644 --- a/docs/user-manual/modules/ROOT/pages/data-format.adoc +++ b/docs/user-manual/modules/ROOT/pages/data-format.adoc @@ -4,95 +4,24 @@ Camel supports a pluggable `DataFormat` to allow messages to be marshalled to and from binary or text formats to support a kind of xref:components:eips:message-translator.adoc[Message Translator]. -== Supported data formats - -There are more than 40 different xref:components:dataformats:index.adoc[Data Formats] that -supports formats such as XML, CSV, JSon, YAML, Avro, Protobuf, and many more. - -== Unmarshalling - -If you receive a message from one of the Camel -xref:component.adoc[Components] such as xref:components::file-component.adoc[File], -xref:components::http-component.adoc[HTTP] or xref:components::jms-component.adoc[JMS] you often want to unmarshal -the payload into some bean so that you can process it using some -xref:bean-integration.adoc[Bean Integration] or perform -xref:predicate.adoc[Predicate] evaluation and so forth. To do this use -the `unmarshal` word in the xref:dsl.adoc[DSL]. - -For example: - -[source,java] ----- -DataFormat jaxb = new JaxbDataFormat("com.acme.model"); - -from("activemq:My.Queue"). - unmarshal(jaxb). - to("mqseries:Another.Queue"); ----- +image::images/MessageTranslator.gif[image] -The above uses a named DataFormat of `jaxb` which is configured with a -number of Java package names. You can if you prefer use a named -reference to a data format which can then be defined in your -xref:registry.adoc[Registry] such as via your xref:spring.adoc[Spring] -XML file. +Camel has support for message transformation using several techniques. +One such technique is data formats, where marshal and unmarshal comes from. -== Marshalling +So in other words the xref:components:eips:marshal-eip.adoc[Marshal] and +xref:components:eips:unmarshal-eip.adoc[Unmarshal] EIPs +are used data formats. -Marshalling is the opposite of unmarshalling, where a bean is marshalled -into some binary or textual format for transmission over some transport -via a Camel xref:component.adoc[Component]. Marshalling is used in the -same way as unmarshalling above; in the xref:dsl.adoc[DSL] you can use a -DataFormat instance, you can configure the DataFormat dynamically using -the DSL or you can refer to a named instance of the format in the -xref:registry.adoc[Registry]. +- _Marshal_ - Transforms the message body (such as Java object) into a binary or textual format, ready to be wired over the network. +- _Unmarshal_ - Transforms data in some binary or textual format (such as received over the network) +into a Java object; or some other representation according to the data format being used. -The following example marshals using a -named JAXB data format to perform a kind of -xref:components:eips:message-translator.adoc[Message Translator]: - -[source,java] ----- -from("file://foo/bar"). - marshal("jaxb"). - to("activemq:Some.Queue"); ----- - -== Example using Spring XML - -This example shows how to configure the data type just once and reuse it -on multiple routes: - -[source,xml] ----- -<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> - <dataFormats> - <jaxb id="myJaxb" prettyPrint="true" contextPath="org.apache.camel.example"/> - </dataFormats> - - <route> - <from uri="direct:start"/> - <marshal> - <custom ref="myJaxb"/> - </marshal> - <to uri="direct:marshalled"/> - </route> - <route> - <from uri="direct:marshalled"/> - <unmarshal> - <custom ref="myJaxb"/> - </unmarshal> - <to uri="mock:result"/> - </route> +== Supported data formats -</camelContext> ----- +There are more than 40 different data formats that +supports formats such as XML, CSV, JSon, YAML, Avro, Protobuf, and many more. -You can also define reusable data formats as Spring beans: +== Example -[source,xml] ----- -<bean id="myJaxb" class="org.apache.camel.model.dataformat.JaxbDataFormat"> - <property name="prettyPrint" value="true"/> - <property name="contextPath" value="org.apache.camel.example"/> -</bean> ----- +See xref:components:eips:marshal-eip.adoc[Marshal] for more information and examples.
