Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAMEL-19988 #11721

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ static boolean setProperty(
}
}

boolean myself = false;
try {
try {
// If the type is null or it matches the needed type, just use the value directly
Expand All @@ -620,6 +621,8 @@ static boolean setProperty(
if ((parameterType == Boolean.class || parameterType == boolean.class) && ref instanceof String) {
String val = (String) ref;
if (!val.equalsIgnoreCase("true") && !val.equalsIgnoreCase("false")) {
// this is our self
myself = true;
throw new IllegalArgumentException(
"Cannot convert the String value: " + ref + " to type: " + parameterType
+ " as the value is not true or false");
Expand Down Expand Up @@ -650,7 +653,14 @@ static boolean setProperty(
}
}
// ignore exceptions as there could be another setter method where we could type convert successfully
} catch (SecurityException | NoTypeConversionAvailableException | IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
// this can be either our own or while trying to set the property on the bean that fails in the 3rd party component
if (myself) {
typeConversionFailed = e;
} else {
throw e;
}
} catch (SecurityException | NoTypeConversionAvailableException e) {
typeConversionFailed = e;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static org.apache.camel.builder.component.dsl.Aws2StsComponentBuilderFactory.Aws
}
/**
* AWS Timestream (camel-aws2-timestream)
* A Camel Amazon Web Services TimeStream component
* Write records and execute queries on AWS time-series database
*
* Category: cloud,database
* Since: 4.1
Expand Down Expand Up @@ -1627,6 +1627,7 @@ static org.apache.camel.builder.component.dsl.GoogleStorageComponentBuilderFacto
*
* @return the dsl builder
*/
@Deprecated
static org.apache.camel.builder.component.dsl.GrapeComponentBuilderFactory.GrapeComponentBuilder grape() {
return org.apache.camel.builder.component.dsl.GrapeComponentBuilderFactory.grape();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.camel.component.aws2.timestream.Timestream2Component;

/**
* A Camel Amazon Web Services TimeStream component
* Write records and execute queries on AWS time-series database
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
Expand All @@ -32,7 +32,7 @@ public interface Aws2TimestreamComponentBuilderFactory {

/**
* AWS Timestream (camel-aws2-timestream)
* A Camel Amazon Web Services TimeStream component
* Write records and execute queries on AWS time-series database
*
* Category: cloud,database
* Since: 4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public interface GrapeComponentBuilderFactory {
*
* @return the dsl builder
*/
@Deprecated
static GrapeComponentBuilder grape() {
return new GrapeComponentBuilderImpl();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,27 @@ default KafkaComponentBuilder pollTimeoutMs(java.lang.Long pollTimeoutMs) {
doSetProperty("pollTimeoutMs", pollTimeoutMs);
return this;
}
/**
* Whether to eager validate that broker host:port is valid and can be
* DNS resolved to known host during starting this consumer. If the
* validation fails then an exception is thrown which makes Camel fail
* fast. Disabling this will postpone the validation after the consumer
* is started, and Camel will keep re-connecting in case of validation
* or DNS resolution error.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: consumer
*
* @param preValidateHostAndPort the value to set
* @return the dsl builder
*/
default KafkaComponentBuilder preValidateHostAndPort(
boolean preValidateHostAndPort) {
doSetProperty("preValidateHostAndPort", preValidateHostAndPort);
return this;
}
/**
* Set if KafkaConsumer will read from the beginning or the end on
* startup: SeekPolicy.BEGINNING: read from the beginning.
Expand Down Expand Up @@ -2234,6 +2255,7 @@ protected boolean setPropertyOnComponent(
case "partitionAssignor": getOrCreateConfiguration((KafkaComponent) component).setPartitionAssignor((java.lang.String) value); return true;
case "pollOnError": getOrCreateConfiguration((KafkaComponent) component).setPollOnError((org.apache.camel.component.kafka.PollOnError) value); return true;
case "pollTimeoutMs": getOrCreateConfiguration((KafkaComponent) component).setPollTimeoutMs((java.lang.Long) value); return true;
case "preValidateHostAndPort": getOrCreateConfiguration((KafkaComponent) component).setPreValidateHostAndPort((boolean) value); return true;
case "seekTo": getOrCreateConfiguration((KafkaComponent) component).setSeekTo((org.apache.camel.component.kafka.SeekPolicy) value); return true;
case "sessionTimeoutMs": getOrCreateConfiguration((KafkaComponent) component).setSessionTimeoutMs((java.lang.Integer) value); return true;
case "specificAvroReader": getOrCreateConfiguration((KafkaComponent) component).setSpecificAvroReader((boolean) value); return true;
Expand Down
Loading