This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 40afd65ce1ddcceb3ce01cb63bd046dc6585f44e Author: Andrea Cosentino <[email protected]> AuthorDate: Fri Jul 24 08:15:17 2020 +0200 CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS2-Lambda --- .../aws2/lambda/Lambda2ComponentConfigurer.java | 5 ++++ .../aws2/lambda/Lambda2EndpointConfigurer.java | 5 ++++ .../camel/component/aws2/lambda/aws2-lambda.json | 2 ++ .../src/main/docs/aws2-lambda-component.adoc | 6 +++-- .../component/aws2/lambda/Lambda2Component.java | 4 ++- .../aws2/lambda/Lambda2Configuration.java | 15 +++++++++++ .../lambda/LambdaComponentClientRegistryTest.java | 26 +++++++++++++++++++ .../dsl/Aws2LambdaComponentBuilderFactory.java | 16 ++++++++++++ .../builder/endpoint/StaticEndpointBuilders.java | 8 +++--- .../dsl/Lambda2EndpointBuilderFactory.java | 30 ++++++++++++++++++++++ 10 files changed, 110 insertions(+), 7 deletions(-) diff --git a/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java b/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java index 636c51d..5804313 100644 --- a/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java +++ b/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java @@ -28,6 +28,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true; + case "autodiscoverclient": + case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true; case "awslambdaclient": case "awsLambdaClient": getOrCreateConfiguration(target).setAwsLambdaClient(property(camelContext, software.amazon.awssdk.services.lambda.LambdaClient.class, value)); return true; case "basicpropertybinding": @@ -57,6 +59,7 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem public Map<String, Object> getAllOptions(Object target) { Map<String, Object> answer = new CaseInsensitiveMap(); answer.put("accessKey", java.lang.String.class); + answer.put("autoDiscoverClient", boolean.class); answer.put("awsLambdaClient", software.amazon.awssdk.services.lambda.LambdaClient.class); answer.put("basicPropertyBinding", boolean.class); answer.put("configuration", org.apache.camel.component.aws2.lambda.Lambda2Configuration.class); @@ -78,6 +81,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": return getOrCreateConfiguration(target).getAccessKey(); + case "autodiscoverclient": + case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient(); case "awslambdaclient": case "awsLambdaClient": return getOrCreateConfiguration(target).getAwsLambdaClient(); case "basicpropertybinding": diff --git a/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java b/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java index c68345b..15d1187 100644 --- a/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java +++ b/components/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java @@ -21,6 +21,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true; + case "autodiscoverclient": + case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true; case "awslambdaclient": case "awsLambdaClient": target.getConfiguration().setAwsLambdaClient(property(camelContext, software.amazon.awssdk.services.lambda.LambdaClient.class, value)); return true; case "basicpropertybinding": @@ -50,6 +52,7 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme public Map<String, Object> getAllOptions(Object target) { Map<String, Object> answer = new CaseInsensitiveMap(); answer.put("accessKey", java.lang.String.class); + answer.put("autoDiscoverClient", boolean.class); answer.put("awsLambdaClient", software.amazon.awssdk.services.lambda.LambdaClient.class); answer.put("basicPropertyBinding", boolean.class); answer.put("lazyStartProducer", boolean.class); @@ -71,6 +74,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme switch (ignoreCase ? name.toLowerCase() : name) { case "accesskey": case "accessKey": return target.getConfiguration().getAccessKey(); + case "autodiscoverclient": + case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient(); case "awslambdaclient": case "awsLambdaClient": return target.getConfiguration().getAwsLambdaClient(); case "basicpropertybinding": diff --git a/components/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json b/components/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json index a4a697e..d4ba18b 100644 --- a/components/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json +++ b/components/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json @@ -21,6 +21,7 @@ "lenientProperties": false }, "componentProperties": { + "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the [...] "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "deprecated": false, "secret": false, "description": "Component configuration" }, "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the r [...] "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Operations", "enum": [ "listFunctions", "getFunction", "createAlias", "deleteAlias", "getAlias", "listAliases", "createFunction", "deleteFunction", "invokeFunction", "updateFunction", "createEventSourceMapping", "deleteEventSourceMapping", "listEventSourceMapping", "listTags", "tagResource", "u [...] @@ -37,6 +38,7 @@ }, "properties": { "function": { "kind": "path", "displayName": "Function", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "Name of the Lambda function." }, + "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the [...] "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the [...] "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Operations", "enum": [ "listFunctions", "getFunction", "createAlias", "deleteAlias", "getAlias", "listAliases", "createFunction", "deleteFunction", "invokeFunction", "updateFunction", "createEventSourceMapping", "deleteEventSourceMapping", "listEventSourceMapping", "listTags", "tagResource", " [...] "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" }, diff --git a/components/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc b/components/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc index 3e20745..e6d3bdb 100644 --- a/components/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc +++ b/components/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc @@ -43,13 +43,14 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Lambda component supports 13 options, which are listed below. +The AWS 2 Lambda component supports 14 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type +| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean | *configuration* (producer) | Component configuration | | Lambda2Configuration | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *operation* (producer) | The operation to perform. It can be listFunctions, getFunction, createFunction, deleteFunction or invokeFunction. The value can be one of: listFunctions, getFunction, createAlias, deleteAlias, getAlias, listAliases, createFunction, deleteFunction, invokeFunction, updateFunction, createEventSourceMapping, deleteEventSourceMapping, listEventSourceMapping, listTags, tagResource, untagResource, publishVersion, listVersions | invokeFunction | Lambda2Operations @@ -88,12 +89,13 @@ with the following path and query parameters: |=== -=== Query Parameters (13 parameters): +=== Query Parameters (14 parameters): [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type +| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *operation* (producer) | The operation to perform. It can be listFunctions, getFunction, createFunction, deleteFunction or invokeFunction. The value can be one of: listFunctions, getFunction, createAlias, deleteAlias, getAlias, listAliases, createFunction, deleteFunction, invokeFunction, updateFunction, createEventSourceMapping, deleteEventSourceMapping, listEventSourceMapping, listTags, tagResource, untagResource, publishVersion, listVersions | invokeFunction | Lambda2Operations | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean diff --git a/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java b/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java index a61608d..af9f1c1 100644 --- a/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java +++ b/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java @@ -56,7 +56,9 @@ public class Lambda2Component extends DefaultComponent { Lambda2Endpoint endpoint = new Lambda2Endpoint(uri, this, configuration); setProperties(endpoint, parameters); endpoint.setFunction(remaining); - checkAndSetRegistryClient(configuration, endpoint); + if (endpoint.getConfiguration().isAutoDiscoverClient()) { + checkAndSetRegistryClient(configuration, endpoint); + } if (configuration.getAwsLambdaClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) { throw new IllegalArgumentException("accessKey/secretKey or awsLambdaClient must be specified"); } diff --git a/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java b/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java index 1a3fc79..9da4618 100644 --- a/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java +++ b/components/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java @@ -45,6 +45,8 @@ public class Lambda2Configuration implements Cloneable { private boolean pojoRequest; @UriParam(defaultValue = "false") private boolean trustAllCertificates; + @UriParam(label = "common", defaultValue = "true") + private boolean autoDiscoverClient = true; public LambdaClient getAwsLambdaClient() { return awsLambdaClient; @@ -159,6 +161,19 @@ public class Lambda2Configuration implements Cloneable { public void setTrustAllCertificates(boolean trustAllCertificates) { this.trustAllCertificates = trustAllCertificates; } + + public boolean isAutoDiscoverClient() { + return autoDiscoverClient; + } + + /** + * Setting the autoDiscoverClient mechanism, if true, the component will + * look for a client instance in the registry automatically otherwise it + * will skip that checking. + */ + public void setAutoDiscoverClient(boolean autoDiscoverClient) { + this.autoDiscoverClient = autoDiscoverClient; + } // ************************************************* // diff --git a/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentClientRegistryTest.java b/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentClientRegistryTest.java index 42f853f..d6ce0af 100644 --- a/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentClientRegistryTest.java +++ b/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentClientRegistryTest.java @@ -22,6 +22,8 @@ import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.lambda.LambdaClient; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; public class LambdaComponentClientRegistryTest extends CamelTestSupport { @@ -47,4 +49,28 @@ public class LambdaComponentClientRegistryTest extends CamelTestSupport { .createEndpoint("aws2-lambda://myFunction?operation=getFunction&awsLambdaClient=#awsLambdaClient&accessKey=xxx&secretKey=yyy"); }); } + + @Test + public void createEndpointWithAutoDiscoverClientFalse() throws Exception { + + LambdaClient awsLambdaClient = new AmazonLambdaClientMock(); + context.getRegistry().bind("awsLambdaClient", awsLambdaClient); + Lambda2Component component = context.getComponent("aws2-lambda", Lambda2Component.class); + Lambda2Endpoint endpoint = (Lambda2Endpoint)component + .createEndpoint("aws2-lambda://myFunction?operation=getFunction&accessKey=xxx&secretKey=yyy&autoDiscoverClient=false"); + + assertNotSame(awsLambdaClient, endpoint.getConfiguration().getAwsLambdaClient()); + } + + @Test + public void createEndpointWithAutoDiscoverClientTrue() throws Exception { + + LambdaClient awsLambdaClient = new AmazonLambdaClientMock(); + context.getRegistry().bind("awsLambdaClient", awsLambdaClient); + Lambda2Component component = context.getComponent("aws2-lambda", Lambda2Component.class); + Lambda2Endpoint endpoint = (Lambda2Endpoint)component + .createEndpoint("aws2-lambda://myFunction?operation=getFunction&accessKey=xxx&secretKey=yyy"); + + assertSame(awsLambdaClient, endpoint.getConfiguration().getAwsLambdaClient()); + } } diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java index 012ca79..c29aeea 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java @@ -49,6 +49,21 @@ public interface Aws2LambdaComponentBuilderFactory { extends ComponentBuilder<Lambda2Component> { /** + * Setting the autoDiscoverClient mechanism, if true, the component will + * look for a client instance in the registry automatically otherwise it + * will skip that checking. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: common + */ + default Aws2LambdaComponentBuilder autoDiscoverClient( + boolean autoDiscoverClient) { + doSetProperty("autoDiscoverClient", autoDiscoverClient); + return this; + } + /** * Component configuration. * * The option is a: @@ -248,6 +263,7 @@ public interface Aws2LambdaComponentBuilderFactory { String name, Object value) { switch (name) { + case "autoDiscoverClient": getOrCreateConfiguration((Lambda2Component) component).setAutoDiscoverClient((boolean) value); return true; case "configuration": ((Lambda2Component) component).setConfiguration((org.apache.camel.component.aws2.lambda.Lambda2Configuration) value); return true; case "lazyStartProducer": ((Lambda2Component) component).setLazyStartProducer((boolean) value); return true; case "operation": getOrCreateConfiguration((Lambda2Component) component).setOperation((org.apache.camel.component.aws2.lambda.Lambda2Operations) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 4348ec9..e7821f0 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -1293,7 +1293,7 @@ public class StaticEndpointBuilders { * * @param path function */ - public static org.apache.camel.builder.endpoint.dsl.Lambda2EndpointBuilderFactory.Lambda2EndpointBuilder aws2Lambda( + static org.apache.camel.builder.endpoint.dsl.Lambda2EndpointBuilderFactory.Lambda2EndpointBuilder aws2Lambda( String path) { return org.apache.camel.builder.endpoint.dsl.Lambda2EndpointBuilderFactory.endpointBuilder("aws2-lambda", path); } @@ -1314,7 +1314,7 @@ public class StaticEndpointBuilders { * instead of the default name * @param path function */ - public static org.apache.camel.builder.endpoint.dsl.Lambda2EndpointBuilderFactory.Lambda2EndpointBuilder aws2Lambda( + static org.apache.camel.builder.endpoint.dsl.Lambda2EndpointBuilderFactory.Lambda2EndpointBuilder aws2Lambda( String componentName, String path) { return org.apache.camel.builder.endpoint.dsl.Lambda2EndpointBuilderFactory.endpointBuilder(componentName, path); @@ -2037,7 +2037,7 @@ public class StaticEndpointBuilders { * * @param path function */ - static org.apache.camel.builder.endpoint.dsl.LambdaEndpointBuilderFactory.LambdaEndpointBuilder awsLambda( + public static org.apache.camel.builder.endpoint.dsl.LambdaEndpointBuilderFactory.LambdaEndpointBuilder awsLambda( String path) { return org.apache.camel.builder.endpoint.dsl.LambdaEndpointBuilderFactory.endpointBuilder("aws-lambda", path); } @@ -2058,7 +2058,7 @@ public class StaticEndpointBuilders { * instead of the default name * @param path function */ - static org.apache.camel.builder.endpoint.dsl.LambdaEndpointBuilderFactory.LambdaEndpointBuilder awsLambda( + public static org.apache.camel.builder.endpoint.dsl.LambdaEndpointBuilderFactory.LambdaEndpointBuilder awsLambda( String componentName, String path) { return org.apache.camel.builder.endpoint.dsl.LambdaEndpointBuilderFactory.endpointBuilder(componentName, path); diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java index 03dab85..5285f16 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java @@ -38,6 +38,36 @@ public interface Lambda2EndpointBuilderFactory { return (AdvancedLambda2EndpointBuilder) this; } /** + * Setting the autoDiscoverClient mechanism, if true, the component will + * look for a client instance in the registry automatically otherwise it + * will skip that checking. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: common + */ + default Lambda2EndpointBuilder autoDiscoverClient( + boolean autoDiscoverClient) { + doSetProperty("autoDiscoverClient", autoDiscoverClient); + return this; + } + /** + * Setting the autoDiscoverClient mechanism, if true, the component will + * look for a client instance in the registry automatically otherwise it + * will skip that checking. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: true + * Group: common + */ + default Lambda2EndpointBuilder autoDiscoverClient( + String autoDiscoverClient) { + doSetProperty("autoDiscoverClient", autoDiscoverClient); + return this; + } + /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during
