Description
When constructing Camel SQL component with the following URI:
sql:INSERT INTO TABLE ....?batch=true&...&batch=true
Resulting camel endpoint ends up with batch == false. The reason for this is found in
private static void addParameter // this is in UriSupport.java
This method adds values into a list and then setting the parameter does not work correctly. I believe that Camel should be more linient for such "errors" (which can occur if you construct URI programatically).
I suggest parameter value detection. If
existing.equals(value) // to use actual names of variables from the code
then just ignore. DO NOT do the following (list construction; current behavior):
if (existing instanceof List) { list = CastUtils.cast((List<?>) existing); } else { // create a new list to hold the multiple values list = new ArrayList<String>(); String s = existing != null ? existing.toString() : null; if (s != null) { list.add(s); } } list.add(value);
In the end the URI shown in the beginning will result in Component with batch equal to false. Which is really hard to determine why and what happened.
I believe this is a generic problem tho
Attachments
Issue Links
- is related to
-
CAMEL-13688 Camel main - Setting boolean option should have strict conversition
- Resolved
-
CAMEL-13732 Converting to boolean should always be strict
- Resolved
- links to