You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2020/03/15 17:53:40 UTC

[camel] branch master updated: CAMEL-14575: restore timer FAQ entry

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e5e76a  CAMEL-14575: restore timer FAQ entry
1e5e76a is described below

commit 1e5e76aebe88a1193b3173b43420d8c331094f27
Author: Zoran Regvart <zr...@apache.org>
AuthorDate: Sun Mar 15 18:53:32 2020 +0100

    CAMEL-14575: restore timer FAQ entry
    
    We have versions 2.x and 3.0.x of component documentation pointing to
    the latest version of user manual. We need this FAQ entry restored not
    to generate broken links on the website. We don't need to link to it
    from the latest component or user manual.
---
 ...ify-time-period-in-a-human-friendly-syntax.adoc | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/faq/how-do-i-specify-time-period-in-a-human-friendly-syntax.adoc b/docs/user-manual/modules/ROOT/pages/faq/how-do-i-specify-time-period-in-a-human-friendly-syntax.adoc
new file mode 100644
index 0000000..44f7afa
--- /dev/null
+++ b/docs/user-manual/modules/ROOT/pages/faq/how-do-i-specify-time-period-in-a-human-friendly-syntax.adoc
@@ -0,0 +1,55 @@
+[[HowdoIspecifytimeperiodinahumanfriendlysyntax-HowdoIspecifytimeperiodinahumanfriendlysyntax]]
+= How do I specify time period in a human friendly syntax?
+
+*Since Camel 2.3*
+
+Some of the Camel xref:component.adoc[components] offers options to
+specify a time period, which must be entered in milli second as unit.
+This may be unfriendly to read as a human when the value is large such
+as 45min = 2700000 millis.
+
+So in Camel 2.3 you can now configure any endpoint uri parameter using a
+String syntax, which at runtime will get converted to millis (`long`
+type).
+
+You can use the following short syntax, which is most common to use:
+
+[width="100%",cols="50%,50%",options="header",]
+|============
+|Syntax |Unit
+|h |hour
+|m |minute
+|s |second
+|============
+
+So for example the xref:components::timer-component.adoc[Timer] endpoint can be configured as
+follows:
+
+[source,java]
+----
+from("timer:foo?period=45m").to("log:foo");
+----
+
+You can mix and match the units so you can do this as well:
+
+[source,java]
+----
+from("timer:foo?period=1h15m").to("log:foo");
+from("timer:bar?period=2h30s").to("log:bar");
+from("timer:bar?period=3h45m58s").to("log:bar");
+----
+
+However you can also use long syntax:
+
+[width="100%",cols="50%,50%",options="header",]
+|=========================
+|Syntax |Unit
+|hour or hours |hour
+|minute or minutes |minute
+|second or seconds |second
+|=========================
+
+[source,java]
+----
+from("timer:foo?period=45minutes").to("log:foo");
+----