You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/09/25 09:49:10 UTC

[camel] branch master updated (47161c8 -> 07e6e8d)

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

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


    from 47161c8  Reorganize the test infra code (#4294)
     new 0f5b0d5  CAMEL-15561 - Camel-AWS2-Eventbridge: More producer operations - describeRule
     new 3a6673b  Camel-AWS2-Eventbridge: Regen
     new 8bfa2f8  Camel-AWS2-Eventbridge: Regen catalog
     new 6c77209  Camel-AWS2-Eventbridge: Added more tests with localstack and Testcontainers
     new 4908642  Camel-AWS2-Eventbridge: Added docs for describeRule
     new 07e6e8d  Camel-AWS2-Eventbridge: Regen docs

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/catalog/components/aws2-eventbridge.json |  4 +--
 .../catalog/docs/aws2-eventbridge-component.adoc   | 22 +++++++++++--
 .../aws2/eventbridge/aws2-eventbridge.json         |  4 +--
 .../src/main/docs/aws2-eventbridge-component.adoc  | 22 +++++++++++--
 .../aws2/eventbridge/EventbridgeOperations.java    |  1 +
 .../aws2/eventbridge/EventbridgeProducer.java      | 38 ++++++++++++++++++++++
 ... => EventbridgeDescribeRuleLocalstackTest.java} | 15 +++++----
 .../dsl/EventbridgeEndpointBuilderFactory.java     |  1 +
 .../ROOT/pages/aws2-eventbridge-component.adoc     | 22 +++++++++++--
 9 files changed, 112 insertions(+), 17 deletions(-)
 copy components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/{EventbridgeDeleteRuleLocalstackTest.java => EventbridgeDescribeRuleLocalstackTest.java} (83%)


[camel] 06/06: Camel-AWS2-Eventbridge: Regen docs

Posted by ac...@apache.org.
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 07e6e8d421766785be105415770c8018730e84dc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 25 11:48:00 2020 +0200

    Camel-AWS2-Eventbridge: Regen docs
---
 .../camel/catalog/docs/aws2-eventbridge-component.adoc | 18 ++++++++++++++++++
 .../EventbridgeDescribeRuleLocalstackTest.java         |  9 ++++-----
 .../modules/ROOT/pages/aws2-eventbridge-component.adoc | 18 ++++++++++++++++++
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc
index dab7287..ccbdb2f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc
@@ -129,6 +129,7 @@ Camel-AWS2-Eventbridge component provides the following operation on the produce
 - enableRule
 - disableRule
 - listRules
+- describeRule
 
 - PutRule: this operation create a rule related to an eventbus
 
@@ -257,6 +258,23 @@ This operation will disable the firstrule rule from the test eventbus.
 
 This operation will list all the rules with prefix first from the test eventbus.
 
+- DescribeRule: this operation will describe a specified rule related to an eventbus
+
+[source,java]
+--------------------------------------------------------------------------------
+  from("direct:start").process(new Processor() {
+                    
+      @Override
+      public void process(Exchange exchange) throws Exception {
+          exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
+      }
+  })
+  .to("aws2-eventbridge://test?operation=describeRule")
+  .to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation will describe the firstrule rule from the test eventbus.
+
 == Automatic detection of EventbridgeClient client in registry
 
 The component is capable of detecting the presence of an EventbridgeClient bean into the registry.
diff --git a/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java b/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java
index 63297fb..7e6c068 100644
--- a/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java
+++ b/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.camel.component.aws2.eventbridge.localstack;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -30,10 +27,12 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.aws2.eventbridge.EventbridgeConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
-
 import software.amazon.awssdk.services.eventbridge.model.DescribeRuleResponse;
 import software.amazon.awssdk.services.eventbridge.model.Target;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 public class EventbridgeDescribeRuleLocalstackTest extends Aws2EventbridgeBaseTest {
 
     @EndpointInject
@@ -66,7 +65,7 @@ public class EventbridgeDescribeRuleLocalstackTest extends Aws2EventbridgeBaseTe
                 exchange.getIn().setHeader(EventbridgeConstants.TARGETS, targets);
             }
         });
-        
+
         template.send("direct:describe-rule", new Processor() {
 
             @Override
diff --git a/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc b/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc
index 9979dd4..c465236 100644
--- a/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc
@@ -131,6 +131,7 @@ Camel-AWS2-Eventbridge component provides the following operation on the produce
 - enableRule
 - disableRule
 - listRules
+- describeRule
 
 - PutRule: this operation create a rule related to an eventbus
 
@@ -259,6 +260,23 @@ This operation will disable the firstrule rule from the test eventbus.
 
 This operation will list all the rules with prefix first from the test eventbus.
 
+- DescribeRule: this operation will describe a specified rule related to an eventbus
+
+[source,java]
+--------------------------------------------------------------------------------
+  from("direct:start").process(new Processor() {
+                    
+      @Override
+      public void process(Exchange exchange) throws Exception {
+          exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
+      }
+  })
+  .to("aws2-eventbridge://test?operation=describeRule")
+  .to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation will describe the firstrule rule from the test eventbus.
+
 == Automatic detection of EventbridgeClient client in registry
 
 The component is capable of detecting the presence of an EventbridgeClient bean into the registry.


[camel] 02/06: Camel-AWS2-Eventbridge: Regen

Posted by ac...@apache.org.
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 3a6673b3e7d4d054b6a12a7b7bc949d3f1f69115
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 25 11:19:11 2020 +0200

    Camel-AWS2-Eventbridge: Regen
---
 .../org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc    | 4 ++--
 .../apache/camel/component/aws2/eventbridge/aws2-eventbridge.json    | 4 ++--
 .../src/main/docs/aws2-eventbridge-component.adoc                    | 4 ++--
 .../apache/camel/component/aws2/eventbridge/EventbridgeProducer.java | 5 ++---
 .../builder/endpoint/dsl/EventbridgeEndpointBuilderFactory.java      | 1 +
 docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc   | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc
index 953b0cb..dab7287 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-eventbridge-component.adoc
@@ -59,7 +59,7 @@ The AWS 2 Eventbridge component supports 15 options, which are listed below.
 | *eventbridgeClient* (producer) | To use a existing configured AWS Eventbridge as client |  | EventBridgeClient
 | *eventPatternFile* (producer) | EventPattern File |  | String
 | *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) | *Required* The operation to perform. There are 7 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, listRules | putRule | EventbridgeOperations
+| *operation* (producer) | *Required* The operation to perform. There are 8 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, describeRule, listRules | putRule | EventbridgeOperations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the Eventbridge client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the Eventbridge client |  | Integer
@@ -104,7 +104,7 @@ with the following path and query parameters:
 | *eventbridgeClient* (producer) | To use a existing configured AWS Eventbridge as client |  | EventBridgeClient
 | *eventPatternFile* (producer) | EventPattern File |  | String
 | *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) | *Required* The operation to perform. There are 7 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, listRules | putRule | EventbridgeOperations
+| *operation* (producer) | *Required* The operation to perform. There are 8 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, describeRule, listRules | putRule | EventbridgeOperations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the Eventbridge client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the Eventbridge client |  | Integer
diff --git a/components/camel-aws2-eventbridge/src/generated/resources/org/apache/camel/component/aws2/eventbridge/aws2-eventbridge.json b/components/camel-aws2-eventbridge/src/generated/resources/org/apache/camel/component/aws2/eventbridge/aws2-eventbridge.json
index f3c4f22..d64f9dd 100644
--- a/components/camel-aws2-eventbridge/src/generated/resources/org/apache/camel/component/aws2/eventbridge/aws2-eventbridge.json
+++ b/components/camel-aws2-eventbridge/src/generated/resources/org/apache/camel/component/aws2/eventbridge/aws2-eventbridge.json
@@ -27,7 +27,7 @@
     "eventbridgeClient": { "kind": "property", "displayName": "Eventbridge Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.eventbridge.EventBridgeClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS Eventbridge as client" },
     "eventPatternFile": { "kind": "property", "displayName": "Event Pattern File", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "EventPattern File" },
     "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": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.eventbridge.Eventbrid [...]
+    "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "describeRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.event [...]
     "pojoRequest": { "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Eventbridge client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Eventbridge client" },
@@ -44,7 +44,7 @@
     "eventbridgeClient": { "kind": "parameter", "displayName": "Eventbridge Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.eventbridge.EventBridgeClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS Eventbridge as client" },
     "eventPatternFile": { "kind": "parameter", "displayName": "Event Pattern File", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "EventPattern File" },
     "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": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.eventbridge.Eventbri [...]
+    "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "describeRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.even [...]
     "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.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Eventbridge client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Eventbridge client" },
diff --git a/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc b/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc
index 953b0cb..dab7287 100644
--- a/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc
+++ b/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc
@@ -59,7 +59,7 @@ The AWS 2 Eventbridge component supports 15 options, which are listed below.
 | *eventbridgeClient* (producer) | To use a existing configured AWS Eventbridge as client |  | EventBridgeClient
 | *eventPatternFile* (producer) | EventPattern File |  | String
 | *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) | *Required* The operation to perform. There are 7 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, listRules | putRule | EventbridgeOperations
+| *operation* (producer) | *Required* The operation to perform. There are 8 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, describeRule, listRules | putRule | EventbridgeOperations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the Eventbridge client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the Eventbridge client |  | Integer
@@ -104,7 +104,7 @@ with the following path and query parameters:
 | *eventbridgeClient* (producer) | To use a existing configured AWS Eventbridge as client |  | EventBridgeClient
 | *eventPatternFile* (producer) | EventPattern File |  | String
 | *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) | *Required* The operation to perform. There are 7 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, listRules | putRule | EventbridgeOperations
+| *operation* (producer) | *Required* The operation to perform. There are 8 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, describeRule, listRules | putRule | EventbridgeOperations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the Eventbridge client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the Eventbridge client |  | Integer
diff --git a/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java b/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java
index 5511c14..cf677d2 100644
--- a/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java
+++ b/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java
@@ -91,7 +91,7 @@ public class EventbridgeProducer extends DefaultProducer {
                 listRules(getEndpoint().getEventbridgeClient(), exchange);
                 break;
             case describeRule:
-            	describeRule(getEndpoint().getEventbridgeClient(), exchange);
+                describeRule(getEndpoint().getEventbridgeClient(), exchange);
                 break;
             default:
                 throw new IllegalArgumentException("Unsupported operation");
@@ -370,7 +370,6 @@ public class EventbridgeProducer extends DefaultProducer {
             message.setBody(result);
         }
     }
-    
 
     private void describeRule(EventBridgeClient eventbridgeClient, Exchange exchange) throws InvalidPayloadException {
         if (getConfiguration().isPojoRequest()) {
@@ -387,7 +386,7 @@ public class EventbridgeProducer extends DefaultProducer {
                 message.setBody(result);
             }
         } else {
-        	DescribeRuleRequest.Builder builder = DescribeRuleRequest.builder();
+            DescribeRuleRequest.Builder builder = DescribeRuleRequest.builder();
             if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EventbridgeConstants.RULE_NAME))) {
                 String ruleName = exchange.getIn().getHeader(EventbridgeConstants.RULE_NAME, String.class);
                 builder.name(ruleName);
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EventbridgeEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EventbridgeEndpointBuilderFactory.java
index f9acc9b..95edada2 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EventbridgeEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EventbridgeEndpointBuilderFactory.java
@@ -406,6 +406,7 @@ public interface EventbridgeEndpointBuilderFactory {
         deleteRule,
         enableRule,
         disableRule,
+        describeRule,
         listRules;
     }
 
diff --git a/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc b/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc
index 709916a..9979dd4 100644
--- a/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-eventbridge-component.adoc
@@ -61,7 +61,7 @@ The AWS 2 Eventbridge component supports 15 options, which are listed below.
 | *eventbridgeClient* (producer) | To use a existing configured AWS Eventbridge as client |  | EventBridgeClient
 | *eventPatternFile* (producer) | EventPattern File |  | String
 | *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) | *Required* The operation to perform. There are 7 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, listRules | putRule | EventbridgeOperations
+| *operation* (producer) | *Required* The operation to perform. There are 8 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, describeRule, listRules | putRule | EventbridgeOperations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the Eventbridge client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the Eventbridge client |  | Integer
@@ -106,7 +106,7 @@ with the following path and query parameters:
 | *eventbridgeClient* (producer) | To use a existing configured AWS Eventbridge as client |  | EventBridgeClient
 | *eventPatternFile* (producer) | EventPattern File |  | String
 | *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) | *Required* The operation to perform. There are 7 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, listRules | putRule | EventbridgeOperations
+| *operation* (producer) | *Required* The operation to perform. There are 8 enums and the value can be one of: putRule, putTargets, removeTargets, deleteRule, enableRule, disableRule, describeRule, listRules | putRule | EventbridgeOperations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the Eventbridge client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the Eventbridge client |  | Integer


[camel] 03/06: Camel-AWS2-Eventbridge: Regen catalog

Posted by ac...@apache.org.
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 8bfa2f863eb0092bd82cae191d032f329c0b5861
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 25 11:19:51 2020 +0200

    Camel-AWS2-Eventbridge: Regen catalog
---
 .../org/apache/camel/catalog/components/aws2-eventbridge.json         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-eventbridge.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-eventbridge.json
index f3c4f22..d64f9dd 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-eventbridge.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-eventbridge.json
@@ -27,7 +27,7 @@
     "eventbridgeClient": { "kind": "property", "displayName": "Eventbridge Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.eventbridge.EventBridgeClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS Eventbridge as client" },
     "eventPatternFile": { "kind": "property", "displayName": "Event Pattern File", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "EventPattern File" },
     "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": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.eventbridge.Eventbrid [...]
+    "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "describeRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.event [...]
     "pojoRequest": { "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Eventbridge client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Eventbridge client" },
@@ -44,7 +44,7 @@
     "eventbridgeClient": { "kind": "parameter", "displayName": "Eventbridge Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.eventbridge.EventBridgeClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS Eventbridge as client" },
     "eventPatternFile": { "kind": "parameter", "displayName": "Event Pattern File", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "EventPattern File" },
     "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": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.eventbridge.Eventbri [...]
+    "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eventbridge.EventbridgeOperations", "enum": [ "putRule", "putTargets", "removeTargets", "deleteRule", "enableRule", "disableRule", "describeRule", "listRules" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "putRule", "configurationClass": "org.apache.camel.component.aws2.even [...]
     "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.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Eventbridge client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Eventbridge client" },


[camel] 04/06: Camel-AWS2-Eventbridge: Added more tests with localstack and Testcontainers

Posted by ac...@apache.org.
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 6c77209db234356c65858ce27de5ddfeeaa59c65
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 25 11:33:09 2020 +0200

    Camel-AWS2-Eventbridge: Added more tests with localstack and Testcontainers
---
 .../EventbridgeDescribeRuleLocalstackTest.java     | 97 ++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java b/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java
new file mode 100644
index 0000000..63297fb
--- /dev/null
+++ b/components/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDescribeRuleLocalstackTest.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.eventbridge.localstack;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.aws2.eventbridge.EventbridgeConstants;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+
+import software.amazon.awssdk.services.eventbridge.model.DescribeRuleResponse;
+import software.amazon.awssdk.services.eventbridge.model.Target;
+
+public class EventbridgeDescribeRuleLocalstackTest extends Aws2EventbridgeBaseTest {
+
+    @EndpointInject
+    private ProducerTemplate template;
+
+    @EndpointInject("mock:result")
+    private MockEndpoint result;
+
+    @Test
+    public void sendIn() throws Exception {
+        result.expectedMessageCount(1);
+
+        template.send("direct:evs", new Processor() {
+
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
+            }
+        });
+
+        template.send("direct:evs-targets", new Processor() {
+
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
+                Target target = Target.builder().id("sqs-queue").arn("arn:aws:sqs:eu-west-1:780410022472:camel-connector-test")
+                        .build();
+                List<Target> targets = new ArrayList<Target>();
+                targets.add(target);
+                exchange.getIn().setHeader(EventbridgeConstants.TARGETS, targets);
+            }
+        });
+        
+        template.send("direct:describe-rule", new Processor() {
+
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
+            }
+        });
+        assertMockEndpointsSatisfied();
+        assertNotNull(result.getExchanges().get(0).getMessage().getBody(DescribeRuleResponse.class).eventPattern());
+        assertEquals("firstrule", result.getExchanges().get(0).getMessage().getBody(DescribeRuleResponse.class).name());
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                String awsEndpoint
+                        = "aws2-eventbridge://default?operation=putRule&eventPatternFile=file:src/test/resources/eventpattern.json";
+                String target = "aws2-eventbridge://default?operation=putTargets";
+                String describeRule = "aws2-eventbridge://default?operation=describeRule";
+                from("direct:evs").to(awsEndpoint);
+                from("direct:evs-targets").to(target);
+                from("direct:describe-rule").to(describeRule).to("mock:result");
+            }
+        };
+    }
+}


[camel] 01/06: CAMEL-15561 - Camel-AWS2-Eventbridge: More producer operations - describeRule

Posted by ac...@apache.org.
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 0f5b0d50f29dc108a6fa8b7e81c9e846bed9f600
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 25 11:13:37 2020 +0200

    CAMEL-15561 - Camel-AWS2-Eventbridge: More producer operations - describeRule
---
 .../aws2/eventbridge/EventbridgeOperations.java    |  1 +
 .../aws2/eventbridge/EventbridgeProducer.java      | 39 ++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeOperations.java b/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeOperations.java
index 38b86bc..9c923c6 100644
--- a/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeOperations.java
+++ b/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeOperations.java
@@ -24,5 +24,6 @@ public enum EventbridgeOperations {
     deleteRule,
     enableRule,
     disableRule,
+    describeRule,
     listRules
 }
diff --git a/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java b/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java
index 1f6c2f1..5511c14 100644
--- a/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java
+++ b/components/camel-aws2-eventbridge/src/main/java/org/apache/camel/component/aws2/eventbridge/EventbridgeProducer.java
@@ -36,6 +36,8 @@ import software.amazon.awssdk.awscore.exception.AwsServiceException;
 import software.amazon.awssdk.services.eventbridge.EventBridgeClient;
 import software.amazon.awssdk.services.eventbridge.model.DeleteRuleRequest;
 import software.amazon.awssdk.services.eventbridge.model.DeleteRuleResponse;
+import software.amazon.awssdk.services.eventbridge.model.DescribeRuleRequest;
+import software.amazon.awssdk.services.eventbridge.model.DescribeRuleResponse;
 import software.amazon.awssdk.services.eventbridge.model.DisableRuleRequest;
 import software.amazon.awssdk.services.eventbridge.model.DisableRuleResponse;
 import software.amazon.awssdk.services.eventbridge.model.EnableRuleRequest;
@@ -88,6 +90,9 @@ public class EventbridgeProducer extends DefaultProducer {
             case listRules:
                 listRules(getEndpoint().getEventbridgeClient(), exchange);
                 break;
+            case describeRule:
+            	describeRule(getEndpoint().getEventbridgeClient(), exchange);
+                break;
             default:
                 throw new IllegalArgumentException("Unsupported operation");
         }
@@ -365,6 +370,40 @@ public class EventbridgeProducer extends DefaultProducer {
             message.setBody(result);
         }
     }
+    
+
+    private void describeRule(EventBridgeClient eventbridgeClient, Exchange exchange) throws InvalidPayloadException {
+        if (getConfiguration().isPojoRequest()) {
+            Object payload = exchange.getIn().getMandatoryBody();
+            if (payload instanceof DescribeRuleRequest) {
+                DescribeRuleResponse result;
+                try {
+                    result = eventbridgeClient.describeRule((DescribeRuleRequest) payload);
+                } catch (AwsServiceException ase) {
+                    LOG.trace("Describe Rule command returned the error code {}", ase.awsErrorDetails().errorCode());
+                    throw ase;
+                }
+                Message message = getMessageForResponse(exchange);
+                message.setBody(result);
+            }
+        } else {
+        	DescribeRuleRequest.Builder builder = DescribeRuleRequest.builder();
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EventbridgeConstants.RULE_NAME))) {
+                String ruleName = exchange.getIn().getHeader(EventbridgeConstants.RULE_NAME, String.class);
+                builder.name(ruleName);
+            }
+            builder.eventBusName(getConfiguration().getEventbusName());
+            DescribeRuleResponse result;
+            try {
+                result = eventbridgeClient.describeRule(builder.build());
+            } catch (AwsServiceException ase) {
+                LOG.trace("Describe Rule command returned the error code {}", ase.awsErrorDetails().errorCode());
+                throw ase;
+            }
+            Message message = getMessageForResponse(exchange);
+            message.setBody(result);
+        }
+    }
 
     @Override
     public EventbridgeEndpoint getEndpoint() {


[camel] 05/06: Camel-AWS2-Eventbridge: Added docs for describeRule

Posted by ac...@apache.org.
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 490864258382b652f2bf7832582a0105e9d24857
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 25 11:34:40 2020 +0200

    Camel-AWS2-Eventbridge: Added docs for describeRule
---
 .../src/main/docs/aws2-eventbridge-component.adoc      | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc b/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc
index dab7287..ccbdb2f 100644
--- a/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc
+++ b/components/camel-aws2-eventbridge/src/main/docs/aws2-eventbridge-component.adoc
@@ -129,6 +129,7 @@ Camel-AWS2-Eventbridge component provides the following operation on the produce
 - enableRule
 - disableRule
 - listRules
+- describeRule
 
 - PutRule: this operation create a rule related to an eventbus
 
@@ -257,6 +258,23 @@ This operation will disable the firstrule rule from the test eventbus.
 
 This operation will list all the rules with prefix first from the test eventbus.
 
+- DescribeRule: this operation will describe a specified rule related to an eventbus
+
+[source,java]
+--------------------------------------------------------------------------------
+  from("direct:start").process(new Processor() {
+                    
+      @Override
+      public void process(Exchange exchange) throws Exception {
+          exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
+      }
+  })
+  .to("aws2-eventbridge://test?operation=describeRule")
+  .to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation will describe the firstrule rule from the test eventbus.
+
 == Automatic detection of EventbridgeClient client in registry
 
 The component is capable of detecting the presence of an EventbridgeClient bean into the registry.