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

davsclaus pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new b58d39ba6a2 Fixed default host and port for zeebe service and improved 
documentation with JSON examples (#9804) (#9814)
b58d39ba6a2 is described below

commit b58d39ba6a2d1ccb6e387c91d86732af3d67d6bf
Author: LoRez <karstenreu...@me.com>
AuthorDate: Wed Apr 5 06:30:40 2023 +0200

    Fixed default host and port for zeebe service and improved documentation 
with JSON examples (#9804) (#9814)
---
 .../camel-zeebe/src/main/docs/zeebe-component.adoc | 48 ++++++++++++++++++++++
 .../camel/component/zeebe/ZeebeComponent.java      |  4 +-
 .../camel/component/zeebe/ZeebeComponentTest.java  | 34 +++++++++++++++
 3 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/components/camel-zeebe/src/main/docs/zeebe-component.adoc 
b/components/camel-zeebe/src/main/docs/zeebe-component.adoc
index 380a6f92163..33c265f07af 100644
--- a/components/camel-zeebe/src/main/docs/zeebe-component.adoc
+++ b/components/camel-zeebe/src/main/docs/zeebe-component.adoc
@@ -69,6 +69,8 @@ include::partial$component-endpoint-options.adoc[]
 
 |=======================================================================
 
+The endpoints accept either Java request objects as shown in the examples 
below or JSON. In JSON camel case for property names is replaced with all lower 
case seperated by underscores, e.g. processId becomes process_id.
+
 *Examples*
 
 * startProcess
@@ -92,6 +94,29 @@ include::partial$component-endpoint-options.adoc[]
         });
 
----------------------------------------------------------------------------------------------------------------------
 
+*JSON Request Example*
+
+[source,json]
+----------------------------------------------------------------------------------------------------------------------
+    {
+        "process_id" : "Process_0e3ldfm",
+        "variables" : { "v1": "a", "v2": 10 }
+    }
+----------------------------------------------------------------------------------------------------------------------
+
+*JSON Response Example*
+
+[source,json]
+----------------------------------------------------------------------------------------------------------------------
+    {
+        "success": true,
+        "process_id": "Process_0e3ldfm",
+        "process_instance_key": 2251799813688297,
+        "process_version": 4,
+        "process_key": 2251799813685906
+    }
+----------------------------------------------------------------------------------------------------------------------
+
 * cancelProcess
 
 [source,java]
@@ -134,6 +159,29 @@ include::partial$component-endpoint-options.adoc[]
         });
 
----------------------------------------------------------------------------------------------------------------------
 
+*JSON Request Example*
+
+[source,json]
+----------------------------------------------------------------------------------------------------------------------
+    {
+        "correlation_key" : "messageKey",
+        "time-to-live" : 100,
+        "variables" : { "v1": "a", "v2": 10 },
+        "name" : "MessageName"
+    }
+----------------------------------------------------------------------------------------------------------------------
+
+*JSON Response Example*
+
+[source,json]
+----------------------------------------------------------------------------------------------------------------------
+    {
+        "success": true,
+        "correlation_key": "messageKey",
+        "message_key": 2251799813688336
+    }
+----------------------------------------------------------------------------------------------------------------------
+
 * completeJob
 
 [source,java]
diff --git 
a/components/camel-zeebe/src/main/java/org/apache/camel/component/zeebe/ZeebeComponent.java
 
b/components/camel-zeebe/src/main/java/org/apache/camel/component/zeebe/ZeebeComponent.java
index fbdb724f1f5..5a7b6dcd6c4 100644
--- 
a/components/camel-zeebe/src/main/java/org/apache/camel/component/zeebe/ZeebeComponent.java
+++ 
b/components/camel-zeebe/src/main/java/org/apache/camel/component/zeebe/ZeebeComponent.java
@@ -29,9 +29,9 @@ import org.apache.camel.support.service.ServiceHelper;
 public class ZeebeComponent extends DefaultComponent {
 
     @Metadata(defaultValue = "" + ZeebeConstants.DEFAULT_GATEWAY_HOST, label = 
"security")
-    String gatewayHost;
+    String gatewayHost = ZeebeConstants.DEFAULT_GATEWAY_HOST;
     @Metadata(defaultValue = "" + ZeebeConstants.DEFAULT_GATEWAY_PORT, label = 
"security")
-    int gatewayPort;
+    int gatewayPort = ZeebeConstants.DEFAULT_GATEWAY_PORT;
     @Metadata(label = "security", secret = true)
     String clientId;
     @Metadata(label = "security", secret = true)
diff --git 
a/components/camel-zeebe/src/test/java/org/apache/camel/component/zeebe/ZeebeComponentTest.java
 
b/components/camel-zeebe/src/test/java/org/apache/camel/component/zeebe/ZeebeComponentTest.java
new file mode 100644
index 00000000000..64e8f8aba74
--- /dev/null
+++ 
b/components/camel-zeebe/src/test/java/org/apache/camel/component/zeebe/ZeebeComponentTest.java
@@ -0,0 +1,34 @@
+/*
+ * 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.zeebe;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class ZeebeComponentTest {
+
+    @Test
+    void getZeebeService() {
+        // Verify Defaults
+        ZeebeComponent component = new ZeebeComponent();
+
+        assertEquals(component.getGatewayHost(), 
ZeebeConstants.DEFAULT_GATEWAY_HOST);
+        assertEquals(component.getGatewayPort(), 
ZeebeConstants.DEFAULT_GATEWAY_PORT);
+    }
+}

Reply via email to