You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/05/22 06:38:30 UTC

[1/3] camel git commit: CAMEL-9954: Documentation for changes since 2.18.0

Repository: camel
Updated Branches:
  refs/heads/master c3b236dbe -> 9863e83d7


CAMEL-9954: Documentation for changes since 2.18.0


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/87129c85
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/87129c85
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/87129c85

Branch: refs/heads/master
Commit: 87129c85ec7258fbb8fc9d95b82f42a2c3bd2895
Parents: c3b236d
Author: Arno Noordover <ar...@noordover.net>
Authored: Sat May 21 17:52:20 2016 +0200
Committer: Arno Noordover <ar...@noordover.net>
Committed: Sat May 21 17:52:20 2016 +0200

----------------------------------------------------------------------
 components/camel-bindy/src/main/docs/bindy.adoc | 63 +++++++++++++++++++-
 1 file changed, 62 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/87129c85/components/camel-bindy/src/main/docs/bindy.adoc
----------------------------------------------------------------------
diff --git a/components/camel-bindy/src/main/docs/bindy.adoc b/components/camel-bindy/src/main/docs/bindy.adoc
index cd6260e..f236c2b 100644
--- a/components/camel-bindy/src/main/docs/bindy.adoc
+++ b/components/camel-bindy/src/main/docs/bindy.adoc
@@ -66,7 +66,8 @@ the POJO like :
 * KeyValuePairField (for key = value format like we have in FIX
 financial messages),
 * Section (to identify header, body and footer section),
-* OneToMany
+* OneToMany,
+* BindyConverter (since 2.18.0)
 
 This section will describe them :
 
@@ -1499,6 +1500,66 @@ public class Security {
     private String side;
 ---------------------------------------------------------------------------------------------------
 
+[[Bindy-9.BindyConverter]]
+9. BindyConverter
+^^^^^^^^^^^^^^^^^
+
+The purpose of the annotation @BindyConverter is define a converter
+to be used on field level. The provided class must implement the
+Format interface.
+
+[source,java]
+---------------------------------------------------------------------------------------------------
+...
+    @FixedLengthRecord(length = 10, paddingChar = ' ')
+    public static class DataModel {
+        @DataField(pos =  1, length = 10, trim = true)
+        @BindyConverter(CustomConverter.class)
+        public String field1;
+    }
+
+    public static class CustomConverter implements Format<String> {
+        @Override
+        public String format(String object) throws Exception {
+            return (new StringBuilder(object)).reverse().toString();
+        }
+
+        @Override
+        public String parse(String string) throws Exception {
+            return (new StringBuilder(string)).reverse().toString();
+        }
+    }
+...
+---------------------------------------------------------------------------------------------------
+
+[[Bindy-SupportedDatatypes]]
+Supported Datatypes
+^^^^^^^^^^^^^^^^^^^
+
+The DefaultFormatFactory makes formatting of the following datatype available by
+returning an instance of the interface FormatFactoryInterface based on the provided
+FormattingOptions:
+
+* BigDecimal
+* BigInteger
+* Boolean
+* Byte
+* Character
+* Date
+* Double
+* Enums
+* Float
+* Integer
+* LocalDate (java 8, since 2.18.0)
+* LocalDateTime (java 8, since 2.18.0)
+* LocalTime (java 8, since 2.18.0)
+* Long
+* Short
+* String
+
+The DefaultFormatFactory can be overridden by providing an instance of
+FactoryRegistry in the registry in use (e.g. spring or JNDI).
+
 [[Bindy-UsingtheJavaDSL]]
 Using the Java DSL
 ^^^^^^^^^^^^^^^^^^


[3/3] camel git commit: Component docs

Posted by da...@apache.org.
Component docs


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9863e83d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9863e83d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9863e83d

Branch: refs/heads/master
Commit: 9863e83d789c94682e373b43aebb28691ae3d8ca
Parents: 4cbf2c1
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 22 08:38:08 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 22 08:38:08 2016 +0200

----------------------------------------------------------------------
 components/camel-sjms/src/main/docs/sjms-batch.adoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9863e83d/components/camel-sjms/src/main/docs/sjms-batch.adoc
----------------------------------------------------------------------
diff --git a/components/camel-sjms/src/main/docs/sjms-batch.adoc b/components/camel-sjms/src/main/docs/sjms-batch.adoc
index 715ae59..4c81839 100644
--- a/components/camel-sjms/src/main/docs/sjms-batch.adoc
+++ b/components/camel-sjms/src/main/docs/sjms-batch.adoc
@@ -135,6 +135,7 @@ The Simple JMS Batch component supports 1 options which are listed below.
 
 
 
+
 // endpoint options: START
 The Simple JMS Batch component supports 21 endpoint options which are listed below:
 
@@ -147,11 +148,11 @@ The Simple JMS Batch component supports 21 endpoint options which are listed bel
 | allowNullBody | consumer | true | boolean | Whether to allow sending messages with no body. If this option is false and the message body is null then an JMSException is thrown.
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
 | completionInterval | consumer | 1000 | int | The completion interval in millis which causes batches to be completed in a scheduled fixed rate every interval. The batch may be empty if the timeout triggered and there was no messages in the batch. Notice you cannot use both completion timeout and completion interval at the same time only one can be configured.
-| completionPredicate | consumer |  | String | The completion predicate which causes batches to be completed when the predicate evaluates as true. The predicate can be configured using the simple language using the string syntax.
+| completionPredicate | consumer |  | String | The completion predicate which causes batches to be completed when the predicate evaluates as true. The predicate can also be configured using the simple language using the string syntax. You may want to set the option eagerCheckCompletion to true to let the predicate match the incoming message as otherwise it matches the aggregated message.
 | completionSize | consumer | 200 | int | The number of messages consumed at which the batch will be completed
 | completionTimeout | consumer | 500 | int | The timeout in millis from receipt of the first first message when the batch will be completed. The batch may be empty if the timeout triggered and there was no messages in the batch. Notice you cannot use both completion timeout and completion interval at the same time only one can be configured.
 | consumerCount | consumer | 1 | int | The number of JMS sessions to consume from
-| eagerCheckCompletion | consumer | false | boolean | Use eager completion checking which means that the completionPredicate will use the incoming Exchange. At opposed to without eager completion checking the completionPredicate will use the aggregated Exchange.
+| eagerCheckCompletion | consumer | false | boolean | Use eager completion checking which means that the completionPredicate will use the incoming Exchange. As opposed to without eager completion checking the completionPredicate will use the aggregated Exchange.
 | includeAllJMSXProperties | consumer | false | boolean | Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.
 | mapJmsMessage | consumer | true | boolean | Specifies whether Camel should auto map the received JMS message to a suited payload type such as javax.jms.TextMessage to a String etc. See section about how mapping works below for more details.
 | pollDuration | consumer | 1000 | int | The duration in milliseconds of each poll for messages. completionTimeOut will be used if it is shorter and a batch has started.
@@ -170,6 +171,7 @@ The Simple JMS Batch component supports 21 endpoint options which are listed bel
 
 
 
+
 The `completionSize` endpoint attribute is used in conjunction with
 `completionTimeout`, where the first condition to be met will cause the
 aggregated `Exchange` to be emitted down the route.


[2/3] camel git commit: CAMEL-9954: Documentation for changes since 2.18.0

Posted by da...@apache.org.
CAMEL-9954: Documentation for changes since 2.18.0


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4cbf2c11
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4cbf2c11
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4cbf2c11

Branch: refs/heads/master
Commit: 4cbf2c11201eedad606e97617707bd37fa477bcb
Parents: 87129c8
Author: Arno Noordover <ar...@noordover.net>
Authored: Sat May 21 18:01:00 2016 +0200
Committer: Arno Noordover <ar...@noordover.net>
Committed: Sat May 21 18:01:00 2016 +0200

----------------------------------------------------------------------
 components/camel-bindy/src/main/docs/bindy.adoc | 58 +++++++++++++++++++-
 1 file changed, 57 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4cbf2c11/components/camel-bindy/src/main/docs/bindy.adoc
----------------------------------------------------------------------
diff --git a/components/camel-bindy/src/main/docs/bindy.adoc b/components/camel-bindy/src/main/docs/bindy.adoc
index f236c2b..2a2a306 100644
--- a/components/camel-bindy/src/main/docs/bindy.adoc
+++ b/components/camel-bindy/src/main/docs/bindy.adoc
@@ -67,7 +67,8 @@ the POJO like :
 financial messages),
 * Section (to identify header, body and footer section),
 * OneToMany,
-* BindyConverter (since 2.18.0)
+* BindyConverter (since 2.18.0),
+* FormatFactories (since 2.18.0)
 
 This section will describe them :
 
@@ -1532,6 +1533,61 @@ Format interface.
 ...
 ---------------------------------------------------------------------------------------------------
 
+[[Bindy-10.FormatFactories]]
+10. FormatFactories
+^^^^^^^^^^^^^^^^^^^
+
+The purpose of the annotation @FormatFactories is to define a set of converters
+at record-level. The provided classes must implement the FormatFactoryInterface interface.
+
+[source,java]
+---------------------------------------------------------------------------------------------------
+    @CsvRecord(separator = ",")
+    @FormatFactories({OrderNumberFormatFactory.class})
+    public static class Order {
+
+        @DataField(pos = 1)
+        private OrderNumber orderNr;
+
+        @DataField(pos = 2)
+        private String firstName;
+
+...
+    }
+
+    public static class OrderNumber {
+        private int orderNr;
+
+        public static OrderNumber ofString(String orderNumber) {
+            OrderNumber result = new OrderNumber();
+            result.orderNr = Integer.valueOf(orderNumber);
+            return result;
+        }
+    }
+
+    public static class OrderNumberFormatFactory extends AbstractFormatFactory {
+
+        {
+            supportedClasses.add(OrderNumber.class);
+        }
+
+        @Override
+        public Format<?> build(FormattingOptions formattingOptions) {
+            return new Format<OrderNumber>() {
+                @Override
+                public String format(OrderNumber object) throws Exception {
+                    return String.valueOf(object.orderNr);
+                }
+
+                @Override
+                public OrderNumber parse(String string) throws Exception {
+                    return OrderNumber.ofString(string);
+                }
+            };
+        }
+    }
+---------------------------------------------------------------------------------------------------
+
 [[Bindy-SupportedDatatypes]]
 Supported Datatypes
 ^^^^^^^^^^^^^^^^^^^