From 61c7bef7d54485c62f283f09e83a576ece377b65 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 4 Apr 2024 09:34:08 +0200 Subject: [PATCH] feat(rabbitmq): Add to template generator (#2246) * feat(rabbitmq): Add to template generator * feat(rabbitmq): Move pattern constraint in the right place * feat(rabbitmq): Refactor RabbitMq E2E tests * feat(rabbitmq): Add missing annotations to some fields * feat(rabbitmq): Refactor existing RabbitMq tests * Outbound GitLab Connector enhancements (#2214) * feat(gitlab): list repository branches * feat(gitlab): create repository branch * feat(gitlab): create repository file * feat(gitlab): create merge request * chore(gitlab): review feedback * fix(rest): more meaningful error message on invalid host (#2245) * fix(deps): update aws-java-sdk monorepo to v1.12.688 (#2253) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update dependency com.google.apis:google-api-services-sheets to v4-rev20240319-2.0.0 (#2254) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(sendgrid): capitalize sender group name in the template (#2252) * chore(deps): update dependency org.cyclonedx:cyclonedx-maven-plugin to v2.8.0 (#2256) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update dependency com.microsoft.graph:microsoft-graph to v6.5.0 (#2258) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(rabbitmq): Add RabbitMq InbC E2E tests * feat(rabbitmq): Add URI Pattern validation * feat(rabbitmq): Add missing $ to the URI Pattern * feat(rabbitmq): Revert BpmnFile debug change * feat(rabbitmq): Use the existing secrets Pattern for consistency * bug(inboundc): Fix potential infinite retries on message idempotency check fails (#2281) * ci: fix integration test GHA (#2274) * fix(generator): FEEL mode = disabled not applied in some cases (#2286) * feat(template generator): set default value feel = false for all inbound connectors (#2264) * fix(generator): standardize line endings in generated element templates (#2288) * chore(sns): migrate to element template generator (#2266) * chore(slack): migrate slack inbound to generator (#2279) * chore(inbound,sqs): move to generator (#2249) * chore(inbound,sqs): move to generator * fix(sqs): fixed correct template overrides Co-authored-by: Oleksii Ivanov <108869886+Oleksiivanov@users.noreply.github.com> * chore(inbound,sqs): corrected generator props --------- Co-authored-by: Oleksii Ivanov <108869886+Oleksiivanov@users.noreply.github.com> * feat(rabbitmq): Rebase main + re generate all templates --------- Co-authored-by: Wolfgang Amann <8766375+wollefitz@users.noreply.github.com> Co-authored-by: Igor Petrov <108870003+igpetrov@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Pavel Kotelevsky <38818382+chillleader@users.noreply.github.com> Co-authored-by: Oleksii Ivanov <108869886+Oleksiivanov@users.noreply.github.com> Co-authored-by: Mark Farkas <119574841+markfarkas-camunda@users.noreply.github.com> --- .../io/camunda/connector/e2e/BpmnFile.java | 48 +- .../connector/e2e/BaseRabbitMqTest.java | 33 +- .../e2e/RabbitMqInboundStartEventTests.java | 168 +++++ ...qTests.java => RabbitMqOutboundTests.java} | 39 +- .../resources/intermediate-catch-event.bpmn | 63 ++ .../rabbitmq-outbound-connector-hybrid.json | 6 +- .../rabbitmq-inbound-connector-boundary.json | 601 ++++++++-------- ...bbitmq-inbound-connector-intermediate.json | 602 ++++++++-------- ...bitmq-inbound-connector-message-start.json | 661 +++++++++--------- ...abbitmq-inbound-connector-start-event.json | 489 +++++++------ .../rabbitmq-outbound-connector.json | 6 +- connectors/rabbitmq/pom.xml | 23 +- .../common/model/FactoryRoutingData.java | 12 + .../common/model/UriAuthentication.java | 4 + .../rabbitmq/inbound/RabbitMqExecutable.java | 44 +- .../model/RabbitMqInboundProperties.java | 35 +- 16 files changed, 1578 insertions(+), 1256 deletions(-) create mode 100644 connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqInboundStartEventTests.java rename connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/{RabbitMqTests.java => RabbitMqOutboundTests.java} (85%) create mode 100644 connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/resources/intermediate-catch-event.bpmn diff --git a/connectors-e2e-test/connectors-e2e-test-base/src/main/java/io/camunda/connector/e2e/BpmnFile.java b/connectors-e2e-test/connectors-e2e-test-base/src/main/java/io/camunda/connector/e2e/BpmnFile.java index 18df1c3a97..1cda92332f 100644 --- a/connectors-e2e-test/connectors-e2e-test-base/src/main/java/io/camunda/connector/e2e/BpmnFile.java +++ b/connectors-e2e-test/connectors-e2e-test-base/src/main/java/io/camunda/connector/e2e/BpmnFile.java @@ -34,6 +34,28 @@ public BpmnFile(BpmnModelInstance bpmnModelInstance) { this.bpmnModelInstance = bpmnModelInstance; } + public static BpmnModelInstance replace(String resourceName, Replace... replaces) { + try { + var resource = BpmnFile.class.getClassLoader().getResource(resourceName); + var file = new File(resource.toURI()); + return replace(file, replaces); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static BpmnModelInstance replace(File file, Replace... replaces) { + try { + var modelXml = IOUtils.toString(file.toURI(), StandardCharsets.UTF_8); + for (var replace : replaces) { + modelXml = modelXml.replaceAll(replace.oldValue, replace.newValue); + } + return Bpmn.readModelFromStream(IOUtils.toInputStream(modelXml, StandardCharsets.UTF_8)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + public BpmnFile writeToFile(File file) { bpmnFile = file; Bpmn.writeModelToFile(bpmnFile, bpmnModelInstance); @@ -62,26 +84,8 @@ public BpmnModelInstance apply(File template, String elementId, File output) { } } - public static BpmnModelInstance replace(String resourceName, Replace... replaces) { - try { - var resource = BpmnFile.class.getClassLoader().getResource(resourceName); - var file = new File(resource.toURI()); - return replace(file, replaces); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static BpmnModelInstance replace(File file, Replace... replaces) { - try { - var modelXml = IOUtils.toString(file.toURI(), StandardCharsets.UTF_8); - for (var replace : replaces) { - modelXml = modelXml.replaceAll(replace.oldValue, replace.newValue); - } - return Bpmn.readModelFromStream(IOUtils.toInputStream(modelXml, StandardCharsets.UTF_8)); - } catch (Exception e) { - throw new RuntimeException(e); - } + public BpmnModelInstance getBpmnModelInstance() { + return bpmnModelInstance; } public record Replace(String oldValue, String newValue) { @@ -89,8 +93,4 @@ public static Replace replace(String oldValue, String newValue) { return new Replace(oldValue, newValue); } } - - public BpmnModelInstance getBpmnModelInstance() { - return bpmnModelInstance; - } } diff --git a/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/BaseRabbitMqTest.java b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/BaseRabbitMqTest.java index 56deb23fbd..46ccd47433 100644 --- a/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/BaseRabbitMqTest.java +++ b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/BaseRabbitMqTest.java @@ -21,7 +21,6 @@ import io.camunda.connector.runtime.inbound.importer.ProcessDefinitionSearch; import io.camunda.operate.CamundaOperateClient; import io.camunda.zeebe.client.ZeebeClient; -import io.camunda.zeebe.model.bpmn.Bpmn; import io.camunda.zeebe.model.bpmn.BpmnModelInstance; import java.io.File; import java.util.Collections; @@ -32,9 +31,10 @@ import org.springframework.boot.test.web.server.LocalServerPort; public abstract class BaseRabbitMqTest { - protected static final String ELEMENT_TEMPLATE_PATH = + protected static final String ELEMENT_ID = "elementId"; + protected static final String OUTBOUND_ELEMENT_TEMPLATE_PATH = "../../connectors/rabbitmq/element-templates/rabbitmq-outbound-connector.json"; - + protected static final String INTERMEDIATE_CATCH_EVENT_BPMN = "intermediate-catch-event.bpmn"; @TempDir File tempDir; @Autowired ZeebeClient zeebeClient; @@ -50,32 +50,7 @@ void beforeEach() { when(processDefinitionSearch.query()).thenReturn(Collections.emptyList()); } - protected ZeebeTest setupTestWithBpmnModel(String taskName, File elementTemplate) { - BpmnModelInstance model = getBpmnModelInstance(taskName); - BpmnModelInstance updatedModel = getBpmnModelInstance(model, elementTemplate, taskName); - return getZeebeTest(updatedModel); - } - - protected static BpmnModelInstance getBpmnModelInstance(final String serviceTaskName) { - return Bpmn.createProcess() - .executable() - .startEvent() - .serviceTask(serviceTaskName) - .endEvent() - .done(); - } - protected ZeebeTest getZeebeTest(final BpmnModelInstance updatedModel) { - return ZeebeTest.with(zeebeClient) - .deploy(updatedModel) - .createInstance() - .waitForProcessCompletion(); - } - - protected BpmnModelInstance getBpmnModelInstance( - final BpmnModelInstance model, final File elementTemplate, final String taskName) { - return new BpmnFile(model) - .writeToFile(new File(tempDir, "test.bpmn")) - .apply(elementTemplate, taskName, new File(tempDir, "result.bpmn")); + return ZeebeTest.with(zeebeClient).deploy(updatedModel).createInstance(); } } diff --git a/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqInboundStartEventTests.java b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqInboundStartEventTests.java new file mode 100644 index 0000000000..d5e4714851 --- /dev/null +++ b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqInboundStartEventTests.java @@ -0,0 +1,168 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; 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 io.camunda.connector.e2e; + +import static io.camunda.connector.e2e.BpmnFile.replace; +import static org.mockito.Mockito.when; + +import com.rabbitmq.client.Channel; +import com.rabbitmq.client.Connection; +import com.rabbitmq.client.ConnectionFactory; +import io.camunda.connector.api.json.ConnectorsObjectMapperSupplier; +import io.camunda.connector.e2e.app.TestConnectorRuntimeApplication; +import io.camunda.connector.runtime.inbound.lifecycle.InboundConnectorManager; +import io.camunda.operate.exception.OperateException; +import io.camunda.operate.model.ProcessDefinition; +import io.camunda.zeebe.model.bpmn.BpmnModelInstance; +import io.camunda.zeebe.model.bpmn.instance.Process; +import io.camunda.zeebe.process.test.assertions.BpmnAssert; +import io.camunda.zeebe.spring.test.ZeebeSpringTest; +import java.io.IOException; +import java.util.Set; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.testcontainers.containers.RabbitMQContainer; +import org.testcontainers.utility.DockerImageName; + +@SpringBootTest( + classes = {TestConnectorRuntimeApplication.class}, + properties = { + "spring.main.allow-bean-definition-overriding=true", + "camunda.connector.webhook.enabled=false", + "camunda.connector.polling.enabled=true" + }, + webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ZeebeSpringTest +@ExtendWith(MockitoExtension.class) +public class RabbitMqInboundStartEventTests extends BaseRabbitMqTest { + + private static final String QUEUE_NAME = "testQueue"; + private static final String EXCHANGE_NAME = "testExchange"; + private static final String ROUTING_KEY = "testRoutingKey"; + private static String PORT; + private static RabbitMQContainer rabbitMQContainer; + private static ConnectionFactory factory; + + @Autowired InboundConnectorManager inboundManager; + @Mock private ProcessDefinition processDef; + + @BeforeAll + public static void setup() throws IOException, TimeoutException { + rabbitMQContainer = + new RabbitMQContainer(DockerImageName.parse("rabbitmq:3.7.25-management-alpine")); + rabbitMQContainer.start(); + PORT = String.valueOf(rabbitMQContainer.getAmqpPort()); + factory = new ConnectionFactory(); + factory.setHost(rabbitMQContainer.getHost()); + factory.setPort(rabbitMQContainer.getAmqpPort()); + factory.setUsername(rabbitMQContainer.getAdminUsername()); + factory.setPassword(rabbitMQContainer.getAdminPassword()); + + try (Connection connection = factory.newConnection(); + Channel channel = connection.createChannel()) { + channel.queueDeclare(QUEUE_NAME, true, false, false, null); + channel.exchangeDeclare(EXCHANGE_NAME, "direct", true); + channel.queueBind(QUEUE_NAME, EXCHANGE_NAME, ROUTING_KEY); + } + } + + @AfterAll + public static void tearDown() { + rabbitMQContainer.stop(); + } + + @BeforeEach + public void cleanQueue() throws IOException, TimeoutException { + try (Connection connection = factory.newConnection(); + Channel channel = connection.createChannel()) { + // Purge the queue to ensure it is empty before conducting the test + channel.queuePurge(QUEUE_NAME); + } + } + + @Test + public void credentialsAuthenticationReceiveMessageTest() throws Exception { + var model = + replace( + INTERMEDIATE_CATCH_EVENT_BPMN, + BpmnFile.Replace.replace("rabbitMqAuthType", "credentials"), + BpmnFile.Replace.replace("rabbitMqUserName", rabbitMQContainer.getAdminUsername()), + BpmnFile.Replace.replace("rabbitMqPassword", rabbitMQContainer.getAdminPassword()), + BpmnFile.Replace.replace("rabbitMqPort", PORT)); + assertIntermediateCatchEventUsingModel(model); + } + + @Test + public void uriAuthenticationReceiveMessageTest() throws Exception { + String uri = + String.format( + "amqp://%s:%s@localhost:%s/%%2f", + rabbitMQContainer.getAdminUsername(), rabbitMQContainer.getAdminPassword(), PORT); + + var model = + replace( + INTERMEDIATE_CATCH_EVENT_BPMN, + BpmnFile.Replace.replace("rabbitMqAuthType", "uri"), + BpmnFile.Replace.replace("rabbitMqUri", uri)); + + assertIntermediateCatchEventUsingModel(model); + } + + private void assertIntermediateCatchEventUsingModel(BpmnModelInstance model) throws Exception { + Object expectedJsonResponse = + ConnectorsObjectMapperSupplier.DEFAULT_MAPPER.readValue( + "{\"message\":{\"consumerTag\":\"myConsumerTag\",\"body\":{\"foo\": {\"bar\": \"barValue\"}},\"properties\":{}}}", + Object.class); + + mockProcessDefinition(model); + inboundManager.handleNewProcessDefinitions(Set.of(processDef)); + + var bpmnTest = getZeebeTest(model); + postMessage(); + bpmnTest = bpmnTest.waitForProcessCompletion(); + + BpmnAssert.assertThat(bpmnTest.getProcessInstanceEvent()) + .hasVariableWithValue("allResult", expectedJsonResponse); + + BpmnAssert.assertThat(bpmnTest.getProcessInstanceEvent()) + .hasVariableWithValue("partialResult", "barValue"); + } + + private void postMessage() throws Exception { + try (Connection connection = factory.newConnection(); + Channel channel = connection.createChannel()) { + byte[] messageBodyBytes = "{\"foo\": {\"bar\": \"barValue\"}}".getBytes(); + channel.basicPublish(EXCHANGE_NAME, ROUTING_KEY, null, messageBodyBytes); + } + } + + private void mockProcessDefinition(BpmnModelInstance model) throws OperateException { + when(camundaOperateClient.getProcessDefinitionModel(1L)).thenReturn(model); + when(processDef.getKey()).thenReturn(1L); + when(processDef.getTenantId()).thenReturn(zeebeClient.getConfiguration().getDefaultTenantId()); + when(processDef.getBpmnProcessId()) + .thenReturn(model.getModelElementsByType(Process.class).stream().findFirst().get().getId()); + } +} diff --git a/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqTests.java b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqOutboundTests.java similarity index 85% rename from connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqTests.java rename to connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqOutboundTests.java index f3bc365768..84d3fca0b3 100644 --- a/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqTests.java +++ b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/java/io/camunda/connector/e2e/RabbitMqOutboundTests.java @@ -26,6 +26,8 @@ import com.rabbitmq.client.GetResponse; import io.camunda.connector.e2e.app.TestConnectorRuntimeApplication; import io.camunda.connector.rabbitmq.outbound.RabbitMqResult; +import io.camunda.zeebe.model.bpmn.Bpmn; +import io.camunda.zeebe.model.bpmn.BpmnModelInstance; import io.camunda.zeebe.spring.test.ZeebeSpringTest; import java.io.File; import java.io.IOException; @@ -51,7 +53,7 @@ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ZeebeSpringTest @ExtendWith(MockitoExtension.class) -public class RabbitMqTests extends BaseRabbitMqTest { +public class RabbitMqOutboundTests extends BaseRabbitMqTest { private static final String QUEUE_NAME = "testQueue"; private static final String EXCHANGE_NAME = "testExchange"; private static final String ROUTING_KEY = "testRoutingKey"; @@ -82,6 +84,11 @@ public static void setup() throws IOException, TimeoutException { } } + @AfterAll + public static void tearDown() { + rabbitMQContainer.stop(); + } + @BeforeEach public void cleanQueue() throws IOException, TimeoutException { try (Connection connection = factory.newConnection(); @@ -91,15 +98,10 @@ public void cleanQueue() throws IOException, TimeoutException { } } - @AfterAll - public static void tearDown() { - rabbitMQContainer.stop(); - } - @Test public void credentialsAuthenticationSendMessageTest() throws Exception { var elementTemplate = - ElementTemplate.from(ELEMENT_TEMPLATE_PATH) + ElementTemplate.from(OUTBOUND_ELEMENT_TEMPLATE_PATH) .property("authentication.authType", "credentials") .property("authentication.userName", rabbitMQContainer.getAdminUsername()) .property("authentication.password", rabbitMQContainer.getAdminPassword()) @@ -112,7 +114,7 @@ public void credentialsAuthenticationSendMessageTest() throws Exception { .property("resultVariable", "result") .writeTo(new File(tempDir, "template.json")); - ZeebeTest bpmnTest = setupTestWithBpmnModel("rabbitMqTask", elementTemplate); + ZeebeTest bpmnTest = setupTestWithBpmnModel(elementTemplate); RabbitMqResult result = RabbitMqResult.success(); assertThat(bpmnTest.getProcessInstanceEvent()).hasVariableWithValue("result", result); @@ -138,7 +140,7 @@ public void uriAuthenticationSendMessageTest() throws Exception { "%2F"); var elementTemplate = - ElementTemplate.from(ELEMENT_TEMPLATE_PATH) + ElementTemplate.from(OUTBOUND_ELEMENT_TEMPLATE_PATH) .property("authentication.authType", "uri") .property("authentication.uri", uri) .property("routing.exchange", EXCHANGE_NAME) @@ -147,7 +149,7 @@ public void uriAuthenticationSendMessageTest() throws Exception { .property("resultVariable", "result") .writeTo(new File(tempDir, "template.json")); - ZeebeTest bpmnTest = setupTestWithBpmnModel("rabbitMqTask", elementTemplate); + ZeebeTest bpmnTest = setupTestWithBpmnModel(elementTemplate); RabbitMqResult result = RabbitMqResult.success(); assertThat(bpmnTest.getProcessInstanceEvent()).hasVariableWithValue("result", result); @@ -171,4 +173,21 @@ private String consumeMessage() throws Exception { } return receivedMessage; } + + protected BpmnModelInstance getBpmnModelInstance() { + return Bpmn.createProcess().executable().startEvent().serviceTask(ELEMENT_ID).endEvent().done(); + } + + protected ZeebeTest setupTestWithBpmnModel(File elementTemplate) { + BpmnModelInstance model = getBpmnModelInstance(); + BpmnModelInstance updatedModel = getBpmnModelInstance(model, elementTemplate); + return getZeebeTest(updatedModel).waitForProcessCompletion(); + } + + protected BpmnModelInstance getBpmnModelInstance( + final BpmnModelInstance model, final File elementTemplate) { + return new BpmnFile(model) + .writeToFile(new File(tempDir, "test.bpmn")) + .apply(elementTemplate, ELEMENT_ID, new File(tempDir, "result.bpmn")); + } } diff --git a/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/resources/intermediate-catch-event.bpmn b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/resources/intermediate-catch-event.bpmn new file mode 100644 index 0000000000..d0013b7bfb --- /dev/null +++ b/connectors-e2e-test/connectors-e2e-test-rabbitmq/src/test/resources/intermediate-catch-event.bpmn @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + Flow_09gkii6 + Flow_0vg65mb + + + + Flow_09gkii6 + + + + Flow_0vg65mb + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/connectors/rabbitmq/element-templates/hybrid/rabbitmq-outbound-connector-hybrid.json b/connectors/rabbitmq/element-templates/hybrid/rabbitmq-outbound-connector-hybrid.json index 6f62a7ba4e..a5667aa745 100644 --- a/connectors/rabbitmq/element-templates/hybrid/rabbitmq-outbound-connector-hybrid.json +++ b/connectors/rabbitmq/element-templates/hybrid/rabbitmq-outbound-connector-hybrid.json @@ -67,7 +67,11 @@ "description" : "URI should contain username, password, host name, port number, and virtual host", "optional" : false, "constraints" : { - "notEmpty" : true + "notEmpty" : true, + "pattern" : { + "value" : "^(amqps?://|secrets|\\{\\{).*$", + "message" : "Must start with amqp(s):// or contain a secret reference" + } }, "feel" : "optional", "group" : "authentication", diff --git a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-boundary.json b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-boundary.json index d9270df1a1..f67c2d3a9d 100644 --- a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-boundary.json +++ b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-boundary.json @@ -1,320 +1,319 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "RabbitMQ Boundary Event Connector", - "id": "io.camunda.connectors.inbound.RabbitMQ.Boundary.v1", - "version": 2, - "description": "Receive a message from RabbitMQ", - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "RabbitMQ Boundary Event Connector", + "id" : "io.camunda.connectors.inbound.RabbitMQ.Boundary.v1", + "description" : "Receive a message from RabbitMQ", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:BoundaryEvent" - ], - "elementType": { - "value": "bpmn:BoundaryEvent", - "eventDefinition": "bpmn:MessageEventDefinition" + "appliesTo" : [ "bpmn:BoundaryEvent" ], + "elementType" : { + "value" : "bpmn:BoundaryEvent", + "eventDefinition" : "bpmn:MessageEventDefinition" }, - "groups": [ - { - "id": "authentication", - "label": "Authentication" - }, - { - "id": "routing", - "label": "Routing" - }, - { - "id": "subscription", - "label": "Subscription" - }, - { - "id": "activation", - "label": "Activation" - }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:connector-rabbitmq-inbound:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } + "groups" : [ { + "id" : "authentication", + "label" : "Authentication" + }, { + "id" : "routing", + "label" : "Routing" + }, { + "id" : "subscription", + "label" : "Subscription" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "correlation", + "label" : "Correlation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:connector-rabbitmq-inbound:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" }, - { - "type": "Hidden", - "generatedValue": { - "type": "uuid" - }, - "binding": { - "type": "bpmn:Message#property", - "name": "name" - } + "type" : "Hidden" + }, { + "id" : "authentication.authType", + "label" : "Connection type", + "value" : "uri", + "group" : "authentication", + "binding" : { + "name" : "authentication.authType", + "type" : "zeebe:property" }, - { - "id": "connectionType", - "label": "Connection type", - "group": "authentication", - "type": "Dropdown", - "value": "uri", - "binding": { - "type": "zeebe:property", - "name": "authentication.authType" - }, - "choices": [ - { - "name": "URI", - "value": "uri" - }, - { - "name": "Username/Password", - "value": "credentials" - } - ] - }, - { - "label": "URI", - "description": "URI should contain username, password, host name, port number, and virtual host", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.uri" - }, - "constraints": { - "notEmpty": true, - "pattern": { - "value": "^(amqps?://)|(\\{\\{secrets\\..+\\}\\}).*$", - "message": "Must start with amqp(s):// or contain a secret reference" - } - }, - "condition": { - "property": "connectionType", - "equals": "uri" + "type" : "Dropdown", + "choices" : [ { + "name" : "URI", + "value" : "uri" + }, { + "name" : "Username/Password", + "value" : "credentials" + } ] + }, { + "id" : "authentication.uri", + "label" : "URI", + "description" : "URI should contain username, password, host name, port number, and virtual host", + "optional" : false, + "constraints" : { + "notEmpty" : true, + "pattern" : { + "value" : "^(amqps?://|secrets|\\{\\{).*$", + "message" : "Must start with amqp(s):// or contain a secret reference" } }, - { - "label": "Username", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.userName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.uri", + "type" : "zeebe:property" }, - { - "label": "Password", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.password" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "uri", + "type" : "simple" }, - { - "label": "Host name", - "description": "Host name: get from RabbitMQ external applocation configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.hostName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "type" : "String" + }, { + "id" : "authentication.userName", + "label" : "Username", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Virtual host", - "description": "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.virtualHost" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.userName", + "type" : "zeebe:property" }, - { - "label": "Port", - "description": "Port: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.port" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Queue name", - "description": "Name of the queue to subscribe to", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "queueName" - }, - "constraints": { - "notEmpty": true - } + "type" : "String" + }, { + "id" : "authentication.password", + "label" : "Password", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Consumer tag", - "description": "Consumer tag to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "consumerTag" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.password", + "type" : "zeebe:property" }, - { - "label": "Arguments", - "description": "Arguments to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "arguments" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Exclusive consumer", - "group": "subscription", - "type": "Dropdown", - "value": "false", - "binding": { - "type": "zeebe:property", - "name": "exclusive" - }, - "choices": [ - { - "name": "Yes", - "value": "true" - }, - { - "name": "No", - "value": "false" - } - ] - }, - { - "label": "Correlation key (process)", - "type": "String", - "group": "activation", - "feel": "required", - "description": "Sets up the correlation key from process variables", - "binding": { - "type": "bpmn:Message#zeebe:subscription#property", - "name": "correlationKey" - }, - "constraints": { - "notEmpty": true - } + "type" : "String" + }, { + "id" : "routing.virtualHost", + "label" : "Virtual host", + "description" : "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Correlation key (payload)", - "type": "String", - "group": "activation", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "correlationKeyExpression" - }, - "description": "Extracts the correlation key from the incoming message payload", - "constraints": { - "notEmpty": true - } + "group" : "routing", + "binding" : { + "name" : "routing.virtualHost", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.hostName", + "label" : "Host name", + "description" : "Host name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.hostName", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.port", + "label" : "Port", + "description" : "Port: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.port", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "queueName", + "label" : "Queue name", + "description" : "Name of the queue to subscribe to", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "subscription", + "binding" : { + "name" : "queueName", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "consumerTag", + "label" : "Consumer tag", + "description" : "Consumer tag to use for the subscription", + "optional" : false, + "group" : "subscription", + "binding" : { + "name" : "consumerTag", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "arguments", + "label" : "Arguments", + "description" : "Arguments to use for the subscription", + "optional" : true, + "feel" : "required", + "group" : "subscription", + "binding" : { + "name" : "arguments", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "exclusive", + "label" : "Exclusive consumer", + "optional" : false, + "value" : "false", + "group" : "subscription", + "binding" : { + "name" : "exclusive", + "type" : "zeebe:property" + }, + "type" : "Dropdown", + "choices" : [ { + "name" : "Yes", + "value" : "true" + }, { + "name" : "No", + "value" : "false" + } ] + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "correlationKeyProcess", + "label" : "Correlation key (process)", + "description" : "Sets up the correlation key from process variables", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKey", + "type" : "bpmn:Message#zeebe:subscription#property" + }, + "type" : "String" + }, { + "id" : "correlationKeyPayload", + "label" : "Correlation key (payload)", + "description" : "Extracts the correlation key from the incoming message payload", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKeyExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageIdExpression", + "label" : "Message ID expression", + "description" : "Expression to extract unique identifier of a message", + "optional" : true, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "messageIdExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageNameUuid", + "generatedValue" : { + "type" : "uuid" + }, + "group" : "correlation", + "binding" : { + "name" : "name", + "type" : "bpmn:Message#property" + }, + "type" : "Hidden" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" }, - { - "label": "Message ID expression", - "feel": "required", - "type": "String", - "optional": true, - "group": "activation", - "binding": { - "type": "zeebe:property", - "name": "messageIdExpression" - }, - "description": "Expression to extract unique identifier of a message" - }, - { - "label": "Activation condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events" - }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" - }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='-7.5 0 271 271' preserveAspectRatio='xMidYMid'%3E%3Cpath d='M245.44 108.308h-85.09a7.738 7.738 0 0 1-7.735-7.734v-88.68C152.615 5.327 147.29 0 140.726 0h-30.375c-6.568 0-11.89 5.327-11.89 11.894v88.143c0 4.573-3.697 8.29-8.27 8.31l-27.885.133c-4.612.025-8.359-3.717-8.35-8.325l.173-88.241C54.144 5.337 48.817 0 42.24 0H11.89C5.321 0 0 5.327 0 11.894V260.21c0 5.834 4.726 10.56 10.555 10.56H245.44c5.834 0 10.56-4.726 10.56-10.56V118.868c0-5.834-4.726-10.56-10.56-10.56zm-39.902 93.233c0 7.645-6.198 13.844-13.843 13.844H167.69c-7.646 0-13.844-6.199-13.844-13.844v-24.005c0-7.646 6.198-13.844 13.844-13.844h24.005c7.645 0 13.843 6.198 13.843 13.844v24.005z' fill='%23F60'/%3E%3C/svg%3E" + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxOCcgaGVpZ2h0PScxOCcgdmlld0JveD0nLTcuNSAwIDI3MSAyNzEnIHByZXNlcnZlQXNwZWN0UmF0aW89J3hNaWRZTWlkJz4KICAgIDxwYXRoIGQ9J00yNDUuNDQgMTA4LjMwOGgtODUuMDlhNy43MzggNy43MzggMCAwIDEtNy43MzUtNy43MzR2LTg4LjY4QzE1Mi42MTUgNS4zMjcgMTQ3LjI5IDAgMTQwLjcyNiAwaC0zMC4zNzVjLTYuNTY4IDAtMTEuODkgNS4zMjctMTEuODkgMTEuODk0djg4LjE0M2MwIDQuNTczLTMuNjk3IDguMjktOC4yNyA4LjMxbC0yNy44ODUuMTMzYy00LjYxMi4wMjUtOC4zNTktMy43MTctOC4zNS04LjMyNWwuMTczLTg4LjI0MUM1NC4xNDQgNS4zMzcgNDguODE3IDAgNDIuMjQgMEgxMS44OUM1LjMyMSAwIDAgNS4zMjcgMCAxMS44OTRWMjYwLjIxYzAgNS44MzQgNC43MjYgMTAuNTYgMTAuNTU1IDEwLjU2SDI0NS40NGM1LjgzNCAwIDEwLjU2LTQuNzI2IDEwLjU2LTEwLjU2VjExOC44NjhjMC01LjgzNC00LjcyNi0xMC41Ni0xMC41Ni0xMC41NnptLTM5LjkwMiA5My4yMzNjMCA3LjY0NS02LjE5OCAxMy44NDQtMTMuODQzIDEzLjg0NEgxNjcuNjljLTcuNjQ2IDAtMTMuODQ0LTYuMTk5LTEzLjg0NC0xMy44NDR2LTI0LjAwNWMwLTcuNjQ2IDYuMTk4LTEzLjg0NCAxMy44NDQtMTMuODQ0aDI0LjAwNWM3LjY0NSAwIDEzLjg0MyA2LjE5OCAxMy44NDMgMTMuODQ0djI0LjAwNXonCiAgICAgICAgICBmaWxsPScjRjYwJy8+Cjwvc3ZnPg==" } } \ No newline at end of file diff --git a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-intermediate.json b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-intermediate.json index ef52e027b9..e102af6fa8 100644 --- a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-intermediate.json +++ b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-intermediate.json @@ -1,321 +1,319 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "RabbitMQ Intermediate Catch Event Connector", - "id": "io.camunda.connectors.inbound.RabbitMQ.Intermediate.v1", - "version": 4, - "description": "Receive a message from RabbitMQ", - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "RabbitMQ Intermediate Catch Event Connector", + "id" : "io.camunda.connectors.inbound.RabbitMQ.Intermediate.v1", + "description" : "Receive a message from RabbitMQ", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:IntermediateCatchEvent", - "bpmn:IntermediateThrowEvent" - ], - "elementType": { - "value": "bpmn:IntermediateCatchEvent", - "eventDefinition": "bpmn:MessageEventDefinition" + "appliesTo" : [ "bpmn:IntermediateCatchEvent", "bpmn:IntermediateThrowEvent" ], + "elementType" : { + "value" : "bpmn:IntermediateCatchEvent", + "eventDefinition" : "bpmn:MessageEventDefinition" }, - "groups": [ - { - "id": "authentication", - "label": "Authentication" - }, - { - "id": "routing", - "label": "Routing" - }, - { - "id": "subscription", - "label": "Subscription" - }, - { - "id": "activation", - "label": "Activation" - }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:connector-rabbitmq-inbound:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } + "groups" : [ { + "id" : "authentication", + "label" : "Authentication" + }, { + "id" : "routing", + "label" : "Routing" + }, { + "id" : "subscription", + "label" : "Subscription" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "correlation", + "label" : "Correlation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:connector-rabbitmq-inbound:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" }, - { - "type": "Hidden", - "generatedValue": { - "type": "uuid" - }, - "binding": { - "type": "bpmn:Message#property", - "name": "name" - } + "type" : "Hidden" + }, { + "id" : "authentication.authType", + "label" : "Connection type", + "value" : "uri", + "group" : "authentication", + "binding" : { + "name" : "authentication.authType", + "type" : "zeebe:property" }, - { - "id": "connectionType", - "label": "Connection type", - "group": "authentication", - "type": "Dropdown", - "value": "uri", - "binding": { - "type": "zeebe:property", - "name": "authentication.authType" - }, - "choices": [ - { - "name": "URI", - "value": "uri" - }, - { - "name": "Username/Password", - "value": "credentials" - } - ] - }, - { - "label": "URI", - "description": "URI should contain username, password, host name, port number, and virtual host", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.uri" - }, - "constraints": { - "notEmpty": true, - "pattern": { - "value": "^(amqps?://)|(\\{\\{secrets\\..+\\}\\}).*$", - "message": "Must start with amqp(s):// or contain a secret reference" - } - }, - "condition": { - "property": "connectionType", - "equals": "uri" + "type" : "Dropdown", + "choices" : [ { + "name" : "URI", + "value" : "uri" + }, { + "name" : "Username/Password", + "value" : "credentials" + } ] + }, { + "id" : "authentication.uri", + "label" : "URI", + "description" : "URI should contain username, password, host name, port number, and virtual host", + "optional" : false, + "constraints" : { + "notEmpty" : true, + "pattern" : { + "value" : "^(amqps?://|secrets|\\{\\{).*$", + "message" : "Must start with amqp(s):// or contain a secret reference" } }, - { - "label": "Username", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.userName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.uri", + "type" : "zeebe:property" }, - { - "label": "Password", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.password" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "uri", + "type" : "simple" }, - { - "label": "Host name", - "description": "Host name: get from RabbitMQ external applocation configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.hostName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "type" : "String" + }, { + "id" : "authentication.userName", + "label" : "Username", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Virtual host", - "description": "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.virtualHost" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.userName", + "type" : "zeebe:property" }, - { - "label": "Port", - "description": "Port: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.port" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Queue name", - "description": "Name of the queue to subscribe to", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "queueName" - }, - "constraints": { - "notEmpty": true - } + "type" : "String" + }, { + "id" : "authentication.password", + "label" : "Password", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Consumer tag", - "description": "Consumer tag to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "consumerTag" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.password", + "type" : "zeebe:property" }, - { - "label": "Arguments", - "description": "Arguments to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "arguments" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Exclusive consumer", - "group": "subscription", - "type": "Dropdown", - "value": "false", - "binding": { - "type": "zeebe:property", - "name": "exclusive" - }, - "choices": [ - { - "name": "Yes", - "value": "true" - }, - { - "name": "No", - "value": "false" - } - ] - }, - { - "label": "Correlation key (process)", - "type": "String", - "group": "activation", - "feel": "required", - "description": "Sets up the correlation key from process variables", - "binding": { - "type": "bpmn:Message#zeebe:subscription#property", - "name": "correlationKey" - }, - "constraints": { - "notEmpty": true - } + "type" : "String" + }, { + "id" : "routing.virtualHost", + "label" : "Virtual host", + "description" : "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Correlation key (payload)", - "type": "String", - "group": "activation", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "correlationKeyExpression" - }, - "description": "Extracts the correlation key from the incoming message payload", - "constraints": { - "notEmpty": true - } + "group" : "routing", + "binding" : { + "name" : "routing.virtualHost", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.hostName", + "label" : "Host name", + "description" : "Host name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.hostName", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.port", + "label" : "Port", + "description" : "Port: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.port", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "queueName", + "label" : "Queue name", + "description" : "Name of the queue to subscribe to", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "subscription", + "binding" : { + "name" : "queueName", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "consumerTag", + "label" : "Consumer tag", + "description" : "Consumer tag to use for the subscription", + "optional" : false, + "group" : "subscription", + "binding" : { + "name" : "consumerTag", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "arguments", + "label" : "Arguments", + "description" : "Arguments to use for the subscription", + "optional" : true, + "feel" : "required", + "group" : "subscription", + "binding" : { + "name" : "arguments", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "exclusive", + "label" : "Exclusive consumer", + "optional" : false, + "value" : "false", + "group" : "subscription", + "binding" : { + "name" : "exclusive", + "type" : "zeebe:property" + }, + "type" : "Dropdown", + "choices" : [ { + "name" : "Yes", + "value" : "true" + }, { + "name" : "No", + "value" : "false" + } ] + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "correlationKeyProcess", + "label" : "Correlation key (process)", + "description" : "Sets up the correlation key from process variables", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKey", + "type" : "bpmn:Message#zeebe:subscription#property" + }, + "type" : "String" + }, { + "id" : "correlationKeyPayload", + "label" : "Correlation key (payload)", + "description" : "Extracts the correlation key from the incoming message payload", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKeyExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageIdExpression", + "label" : "Message ID expression", + "description" : "Expression to extract unique identifier of a message", + "optional" : true, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "messageIdExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageNameUuid", + "generatedValue" : { + "type" : "uuid" + }, + "group" : "correlation", + "binding" : { + "name" : "name", + "type" : "bpmn:Message#property" + }, + "type" : "Hidden" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" }, - { - "label": "Message ID expression", - "feel": "required", - "type": "String", - "optional": true, - "group": "activation", - "binding": { - "type": "zeebe:property", - "name": "messageIdExpression" - }, - "description": "Expression to extract unique identifier of a message" - }, - { - "label": "Activation condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events" - }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" - }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='-7.5 0 271 271' preserveAspectRatio='xMidYMid'%3E%3Cpath d='M245.44 108.308h-85.09a7.738 7.738 0 0 1-7.735-7.734v-88.68C152.615 5.327 147.29 0 140.726 0h-30.375c-6.568 0-11.89 5.327-11.89 11.894v88.143c0 4.573-3.697 8.29-8.27 8.31l-27.885.133c-4.612.025-8.359-3.717-8.35-8.325l.173-88.241C54.144 5.337 48.817 0 42.24 0H11.89C5.321 0 0 5.327 0 11.894V260.21c0 5.834 4.726 10.56 10.555 10.56H245.44c5.834 0 10.56-4.726 10.56-10.56V118.868c0-5.834-4.726-10.56-10.56-10.56zm-39.902 93.233c0 7.645-6.198 13.844-13.843 13.844H167.69c-7.646 0-13.844-6.199-13.844-13.844v-24.005c0-7.646 6.198-13.844 13.844-13.844h24.005c7.645 0 13.843 6.198 13.843 13.844v24.005z' fill='%23F60'/%3E%3C/svg%3E" + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxOCcgaGVpZ2h0PScxOCcgdmlld0JveD0nLTcuNSAwIDI3MSAyNzEnIHByZXNlcnZlQXNwZWN0UmF0aW89J3hNaWRZTWlkJz4KICAgIDxwYXRoIGQ9J00yNDUuNDQgMTA4LjMwOGgtODUuMDlhNy43MzggNy43MzggMCAwIDEtNy43MzUtNy43MzR2LTg4LjY4QzE1Mi42MTUgNS4zMjcgMTQ3LjI5IDAgMTQwLjcyNiAwaC0zMC4zNzVjLTYuNTY4IDAtMTEuODkgNS4zMjctMTEuODkgMTEuODk0djg4LjE0M2MwIDQuNTczLTMuNjk3IDguMjktOC4yNyA4LjMxbC0yNy44ODUuMTMzYy00LjYxMi4wMjUtOC4zNTktMy43MTctOC4zNS04LjMyNWwuMTczLTg4LjI0MUM1NC4xNDQgNS4zMzcgNDguODE3IDAgNDIuMjQgMEgxMS44OUM1LjMyMSAwIDAgNS4zMjcgMCAxMS44OTRWMjYwLjIxYzAgNS44MzQgNC43MjYgMTAuNTYgMTAuNTU1IDEwLjU2SDI0NS40NGM1LjgzNCAwIDEwLjU2LTQuNzI2IDEwLjU2LTEwLjU2VjExOC44NjhjMC01LjgzNC00LjcyNi0xMC41Ni0xMC41Ni0xMC41NnptLTM5LjkwMiA5My4yMzNjMCA3LjY0NS02LjE5OCAxMy44NDQtMTMuODQzIDEzLjg0NEgxNjcuNjljLTcuNjQ2IDAtMTMuODQ0LTYuMTk5LTEzLjg0NC0xMy44NDR2LTI0LjAwNWMwLTcuNjQ2IDYuMTk4LTEzLjg0NCAxMy44NDQtMTMuODQ0aDI0LjAwNWM3LjY0NSAwIDEzLjg0MyA2LjE5OCAxMy44NDMgMTMuODQ0djI0LjAwNXonCiAgICAgICAgICBmaWxsPScjRjYwJy8+Cjwvc3ZnPg==" } } \ No newline at end of file diff --git a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-message-start.json b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-message-start.json index f3127e3ad8..f5287f8c64 100644 --- a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-message-start.json +++ b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-message-start.json @@ -1,354 +1,347 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "RabbitMQ Message Start Event Connector", - "id": "io.camunda.connectors.inbound.RabbitMQ.MessageStart.v1", - "version": 1, - "description": "Receive a message from RabbitMQ", - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "RabbitMQ Message Start Event Connector", + "id" : "io.camunda.connectors.inbound.RabbitMQ.MessageStart.v1", + "description" : "Receive a message from RabbitMQ", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:StartEvent" - ], - "elementType": { - "value": "bpmn:StartEvent", - "eventDefinition": "bpmn:MessageEventDefinition" + "appliesTo" : [ "bpmn:StartEvent" ], + "elementType" : { + "value" : "bpmn:StartEvent", + "eventDefinition" : "bpmn:MessageEventDefinition" }, - "groups": [ - { - "id": "authentication", - "label": "Authentication" - }, - { - "id": "routing", - "label": "Routing" - }, - { - "id": "subscription", - "label": "Subscription" - }, - { - "id": "activation", - "label": "Activation" - }, - { - "id": "correlation", - "label": "Subprocess correlation" - }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:connector-rabbitmq-inbound:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } + "groups" : [ { + "id" : "authentication", + "label" : "Authentication" + }, { + "id" : "routing", + "label" : "Routing" + }, { + "id" : "subscription", + "label" : "Subscription" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "correlation", + "label" : "Correlation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:connector-rabbitmq-inbound:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" }, - { - "type": "Hidden", - "generatedValue": { - "type": "uuid" - }, - "binding": { - "type": "bpmn:Message#property", - "name": "name" - } + "type" : "Hidden" + }, { + "id" : "authentication.authType", + "label" : "Connection type", + "value" : "uri", + "group" : "authentication", + "binding" : { + "name" : "authentication.authType", + "type" : "zeebe:property" }, - { - "id": "connectionType", - "label": "Connection type", - "group": "authentication", - "type": "Dropdown", - "value": "uri", - "binding": { - "type": "zeebe:property", - "name": "authentication.authType" - }, - "choices": [ - { - "name": "URI", - "value": "uri" - }, - { - "name": "Username/Password", - "value": "credentials" - } - ] - }, - { - "label": "URI", - "description": "URI should contain username, password, host name, port number, and virtual host", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.uri" - }, - "constraints": { - "notEmpty": true, - "pattern": { - "value": "^(amqps?://)|(\\{\\{secrets\\..+\\}\\}).*$", - "message": "Must start with amqp(s):// or contain a secret reference" - } - }, - "condition": { - "property": "connectionType", - "equals": "uri" + "type" : "Dropdown", + "choices" : [ { + "name" : "URI", + "value" : "uri" + }, { + "name" : "Username/Password", + "value" : "credentials" + } ] + }, { + "id" : "authentication.uri", + "label" : "URI", + "description" : "URI should contain username, password, host name, port number, and virtual host", + "optional" : false, + "constraints" : { + "notEmpty" : true, + "pattern" : { + "value" : "^(amqps?://|secrets|\\{\\{).*$", + "message" : "Must start with amqp(s):// or contain a secret reference" } }, - { - "label": "Username", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.userName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.uri", + "type" : "zeebe:property" }, - { - "label": "Password", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.password" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "uri", + "type" : "simple" }, - { - "label": "Host name", - "description": "Host name: get from RabbitMQ external applocation configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.hostName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "type" : "String" + }, { + "id" : "authentication.userName", + "label" : "Username", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Virtual host", - "description": "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.virtualHost" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.userName", + "type" : "zeebe:property" }, - { - "label": "Port", - "description": "Port: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.port" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Queue name", - "description": "Name of the queue to subscribe to", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "queueName" - }, - "constraints": { - "notEmpty": true - } + "type" : "String" + }, { + "id" : "authentication.password", + "label" : "Password", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Consumer tag", - "description": "Consumer tag to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "consumerTag" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.password", + "type" : "zeebe:property" }, - { - "label": "Arguments", - "description": "Arguments to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "arguments" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Exclusive consumer", - "group": "subscription", - "type": "Dropdown", - "value": "false", - "binding": { - "type": "zeebe:property", - "name": "exclusive" - }, - "choices": [ - { - "name": "Yes", - "value": "true" - }, - { - "name": "No", - "value": "false" - } - ] - }, - { - "label": "Message ID expression", - "feel": "required", - "type": "String", - "optional": true, - "group": "activation", - "binding": { - "type": "zeebe:property", - "name": "messageIdExpression" - }, - "description": "Expression to extract unique identifier of a message" - }, - { - "label": "Activation condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events" - }, - { - "label": "Correlation required", - "description": "Indicates whether correlation is required. This is needed for event-based subprocess message start events", - "id": "correlationRequired", - "group": "correlation", - "type": "Dropdown", - "value": "notRequired", - "choices": [ - { - "name": "Correlation not required", - "value": "notRequired" - }, - { - "name": "Correlation required", - "value": "required" - } - ], - "binding": { - "type": "zeebe:property", - "name": "correlationRequired" - } + "type" : "String" + }, { + "id" : "routing.virtualHost", + "label" : "Virtual host", + "description" : "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Correlation key (process)", - "type": "String", - "group": "correlation", - "feel": "required", - "description": "Sets up the correlation key from process variables", - "binding": { - "type": "bpmn:Message#zeebe:subscription#property", - "name": "correlationKey" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "correlationRequired", - "equals": "required" - } + "group" : "routing", + "binding" : { + "name" : "routing.virtualHost", + "type" : "zeebe:property" }, - { - "label": "Correlation key (payload)", - "type": "String", - "group": "correlation", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "correlationKeyExpression" - }, - "description": "Extracts the correlation key from the incoming message payload", - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "correlationRequired", - "equals": "required" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.hostName", + "label" : "Host name", + "description" : "Host name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.hostName", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.port", + "label" : "Port", + "description" : "Port: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.port", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "queueName", + "label" : "Queue name", + "description" : "Name of the queue to subscribe to", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "subscription", + "binding" : { + "name" : "queueName", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "consumerTag", + "label" : "Consumer tag", + "description" : "Consumer tag to use for the subscription", + "optional" : false, + "group" : "subscription", + "binding" : { + "name" : "consumerTag", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "arguments", + "label" : "Arguments", + "description" : "Arguments to use for the subscription", + "optional" : true, + "feel" : "required", + "group" : "subscription", + "binding" : { + "name" : "arguments", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "exclusive", + "label" : "Exclusive consumer", + "optional" : false, + "value" : "false", + "group" : "subscription", + "binding" : { + "name" : "exclusive", + "type" : "zeebe:property" + }, + "type" : "Dropdown", + "choices" : [ { + "name" : "Yes", + "value" : "true" + }, { + "name" : "No", + "value" : "false" + } ] + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "correlationRequired", + "label" : "Subprocess correlation required", + "description" : "Indicates whether correlation is required. This is needed for event-based subprocess message start events", + "value" : "notRequired", + "group" : "correlation", + "binding" : { + "name" : "correlationRequired", + "type" : "zeebe:property" + }, + "type" : "Dropdown", + "choices" : [ { + "name" : "Correlation not required", + "value" : "notRequired" + }, { + "name" : "Correlation required", + "value" : "required" + } ] + }, { + "id" : "correlationKeyProcess", + "label" : "Correlation key (process)", + "description" : "Sets up the correlation key from process variables", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKey", + "type" : "bpmn:Message#zeebe:subscription#property" + }, + "condition" : { + "property" : "correlationRequired", + "equals" : "required", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "correlationKeyPayload", + "label" : "Correlation key (payload)", + "description" : "Extracts the correlation key from the incoming message payload", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKeyExpression", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "correlationRequired", + "equals" : "required", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "messageIdExpression", + "label" : "Message ID expression", + "description" : "Expression to extract unique identifier of a message", + "optional" : true, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "messageIdExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageNameUuid", + "generatedValue" : { + "type" : "uuid" + }, + "group" : "correlation", + "binding" : { + "name" : "name", + "type" : "bpmn:Message#property" + }, + "type" : "Hidden" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" - }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='-7.5 0 271 271' preserveAspectRatio='xMidYMid'%3E%3Cpath d='M245.44 108.308h-85.09a7.738 7.738 0 0 1-7.735-7.734v-88.68C152.615 5.327 147.29 0 140.726 0h-30.375c-6.568 0-11.89 5.327-11.89 11.894v88.143c0 4.573-3.697 8.29-8.27 8.31l-27.885.133c-4.612.025-8.359-3.717-8.35-8.325l.173-88.241C54.144 5.337 48.817 0 42.24 0H11.89C5.321 0 0 5.327 0 11.894V260.21c0 5.834 4.726 10.56 10.555 10.56H245.44c5.834 0 10.56-4.726 10.56-10.56V118.868c0-5.834-4.726-10.56-10.56-10.56zm-39.902 93.233c0 7.645-6.198 13.844-13.843 13.844H167.69c-7.646 0-13.844-6.199-13.844-13.844v-24.005c0-7.646 6.198-13.844 13.844-13.844h24.005c7.645 0 13.843 6.198 13.843 13.844v24.005z' fill='%23F60'/%3E%3C/svg%3E" + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxOCcgaGVpZ2h0PScxOCcgdmlld0JveD0nLTcuNSAwIDI3MSAyNzEnIHByZXNlcnZlQXNwZWN0UmF0aW89J3hNaWRZTWlkJz4KICAgIDxwYXRoIGQ9J00yNDUuNDQgMTA4LjMwOGgtODUuMDlhNy43MzggNy43MzggMCAwIDEtNy43MzUtNy43MzR2LTg4LjY4QzE1Mi42MTUgNS4zMjcgMTQ3LjI5IDAgMTQwLjcyNiAwaC0zMC4zNzVjLTYuNTY4IDAtMTEuODkgNS4zMjctMTEuODkgMTEuODk0djg4LjE0M2MwIDQuNTczLTMuNjk3IDguMjktOC4yNyA4LjMxbC0yNy44ODUuMTMzYy00LjYxMi4wMjUtOC4zNTktMy43MTctOC4zNS04LjMyNWwuMTczLTg4LjI0MUM1NC4xNDQgNS4zMzcgNDguODE3IDAgNDIuMjQgMEgxMS44OUM1LjMyMSAwIDAgNS4zMjcgMCAxMS44OTRWMjYwLjIxYzAgNS44MzQgNC43MjYgMTAuNTYgMTAuNTU1IDEwLjU2SDI0NS40NGM1LjgzNCAwIDEwLjU2LTQuNzI2IDEwLjU2LTEwLjU2VjExOC44NjhjMC01LjgzNC00LjcyNi0xMC41Ni0xMC41Ni0xMC41NnptLTM5LjkwMiA5My4yMzNjMCA3LjY0NS02LjE5OCAxMy44NDQtMTMuODQzIDEzLjg0NEgxNjcuNjljLTcuNjQ2IDAtMTMuODQ0LTYuMTk5LTEzLjg0NC0xMy44NDR2LTI0LjAwNWMwLTcuNjQ2IDYuMTk4LTEzLjg0NCAxMy44NDQtMTMuODQ0aDI0LjAwNWM3LjY0NSAwIDEzLjg0MyA2LjE5OCAxMy44NDMgMTMuODQ0djI0LjAwNXonCiAgICAgICAgICBmaWxsPScjRjYwJy8+Cjwvc3ZnPg==" } } \ No newline at end of file diff --git a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-start-event.json b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-start-event.json index 22e1e8e9a5..540cee84fc 100644 --- a/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-start-event.json +++ b/connectors/rabbitmq/element-templates/rabbitmq-inbound-connector-start-event.json @@ -1,269 +1,264 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "RabbitMQ Start Event Connector", - "id": "io.camunda.connectors.inbound.RabbitMQ.StartEvent.v1", - "version": 3, - "description": "Receive a message from RabbitMQ", - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "RabbitMQ Start Event Connector", + "id" : "io.camunda.connectors.inbound.RabbitMQ.StartEvent.v1", + "description" : "Receive a message from RabbitMQ", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:StartEvent" - ], - "elementType": { - "value": "bpmn:StartEvent" + "appliesTo" : [ "bpmn:StartEvent" ], + "elementType" : { + "value" : "bpmn:StartEvent" }, - "groups": [ - { - "id": "authentication", - "label": "Authentication" + "groups" : [ { + "id" : "authentication", + "label" : "Authentication" + }, { + "id" : "routing", + "label" : "Routing" + }, { + "id" : "subscription", + "label" : "Subscription" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:connector-rabbitmq-inbound:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" }, - { - "id": "routing", - "label": "Routing" + "type" : "Hidden" + }, { + "id" : "authentication.authType", + "label" : "Connection type", + "value" : "uri", + "group" : "authentication", + "binding" : { + "name" : "authentication.authType", + "type" : "zeebe:property" }, - { - "id": "subscription", - "label": "Subscription" + "type" : "Dropdown", + "choices" : [ { + "name" : "URI", + "value" : "uri" + }, { + "name" : "Username/Password", + "value" : "credentials" + } ] + }, { + "id" : "authentication.uri", + "label" : "URI", + "description" : "URI should contain username, password, host name, port number, and virtual host", + "optional" : false, + "constraints" : { + "notEmpty" : true, + "pattern" : { + "value" : "^(amqps?://|secrets|\\{\\{).*$", + "message" : "Must start with amqp(s):// or contain a secret reference" + } }, - { - "id": "activation", - "label": "Activation" + "group" : "authentication", + "binding" : { + "name" : "authentication.uri", + "type" : "zeebe:property" }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:connector-rabbitmq-inbound:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "uri", + "type" : "simple" }, - { - "id": "connectionType", - "label": "Connection type", - "group": "authentication", - "type": "Dropdown", - "value": "uri", - "binding": { - "type": "zeebe:property", - "name": "authentication.authType" - }, - "choices": [ - { - "name": "URI", - "value": "uri" - }, - { - "name": "Username/Password", - "value": "credentials" - } - ] + "type" : "String" + }, { + "id" : "authentication.userName", + "label" : "Username", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "URI", - "description": "URI should contain username, password, host name, port number, and virtual host", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.uri" - }, - "constraints": { - "notEmpty": true, - "pattern": { - "value": "^(amqps?://)|(\\{\\{secrets\\..+\\}\\}).*", - "message": "Must start with amqp(s):// or contain a secret reference" - } - }, - "condition": { - "property": "connectionType", - "equals": "uri" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.userName", + "type" : "zeebe:property" }, - { - "label": "Username", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.userName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Password", - "group": "authentication", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "authentication.password" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "type" : "String" + }, { + "id" : "authentication.password", + "label" : "Password", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Host name", - "description": "Host name: get from RabbitMQ external applocation configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.hostName" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "group" : "authentication", + "binding" : { + "name" : "authentication.password", + "type" : "zeebe:property" }, - { - "label": "Virtual host", - "description": "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.virtualHost" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Port", - "description": "Port: get from RabbitMQ external application configurations. Details in the documentation", - "group": "routing", - "type": "String", - "binding": { - "type": "zeebe:property", - "name": "routing.port" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "connectionType", - "equals": "credentials" - } + "type" : "String" + }, { + "id" : "routing.virtualHost", + "label" : "Virtual host", + "description" : "Virtual name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Queue name", - "description": "Name of the queue to subscribe to", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "queueName" - }, - "constraints": { - "notEmpty": true - } + "group" : "routing", + "binding" : { + "name" : "routing.virtualHost", + "type" : "zeebe:property" }, - { - "label": "Consumer tag", - "description": "Consumer tag to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "consumerTag" - } + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" }, - { - "label": "Arguments", - "description": "Arguments to use for the subscription", - "group": "subscription", - "type": "String", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "arguments" - } + "type" : "String" + }, { + "id" : "routing.hostName", + "label" : "Host name", + "description" : "Host name: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.hostName", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "routing.port", + "label" : "Port", + "description" : "Port: get from RabbitMQ external application configurations. Details in the documentation", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "routing", + "binding" : { + "name" : "routing.port", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "authentication.authType", + "equals" : "credentials", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "queueName", + "label" : "Queue name", + "description" : "Name of the queue to subscribe to", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "subscription", + "binding" : { + "name" : "queueName", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "consumerTag", + "label" : "Consumer tag", + "description" : "Consumer tag to use for the subscription", + "optional" : false, + "group" : "subscription", + "binding" : { + "name" : "consumerTag", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "arguments", + "label" : "Arguments", + "description" : "Arguments to use for the subscription", + "optional" : true, + "feel" : "required", + "group" : "subscription", + "binding" : { + "name" : "arguments", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "exclusive", + "label" : "Exclusive consumer", + "optional" : false, + "value" : "false", + "group" : "subscription", + "binding" : { + "name" : "exclusive", + "type" : "zeebe:property" }, - { - "label": "Exclusive consumer", - "group": "subscription", - "type": "Dropdown", - "value": "false", - "binding": { - "type": "zeebe:property", - "name": "exclusive" - }, - "choices": [ - { - "name": "Yes", - "value": "true" - }, - { - "name": "No", - "value": "false" - } - ] + "type" : "Dropdown", + "choices" : [ { + "name" : "Yes", + "value" : "true" + }, { + "name" : "No", + "value" : "false" + } ] + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" }, - { - "label": "Activation condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events" + "type" : "String" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='-7.5 0 271 271' preserveAspectRatio='xMidYMid'%3E%3Cpath d='M245.44 108.308h-85.09a7.738 7.738 0 0 1-7.735-7.734v-88.68C152.615 5.327 147.29 0 140.726 0h-30.375c-6.568 0-11.89 5.327-11.89 11.894v88.143c0 4.573-3.697 8.29-8.27 8.31l-27.885.133c-4.612.025-8.359-3.717-8.35-8.325l.173-88.241C54.144 5.337 48.817 0 42.24 0H11.89C5.321 0 0 5.327 0 11.894V260.21c0 5.834 4.726 10.56 10.555 10.56H245.44c5.834 0 10.56-4.726 10.56-10.56V118.868c0-5.834-4.726-10.56-10.56-10.56zm-39.902 93.233c0 7.645-6.198 13.844-13.843 13.844H167.69c-7.646 0-13.844-6.199-13.844-13.844v-24.005c0-7.646 6.198-13.844 13.844-13.844h24.005c7.645 0 13.843 6.198 13.843 13.844v24.005z' fill='%23F60'/%3E%3C/svg%3E" + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxOCcgaGVpZ2h0PScxOCcgdmlld0JveD0nLTcuNSAwIDI3MSAyNzEnIHByZXNlcnZlQXNwZWN0UmF0aW89J3hNaWRZTWlkJz4KICAgIDxwYXRoIGQ9J00yNDUuNDQgMTA4LjMwOGgtODUuMDlhNy43MzggNy43MzggMCAwIDEtNy43MzUtNy43MzR2LTg4LjY4QzE1Mi42MTUgNS4zMjcgMTQ3LjI5IDAgMTQwLjcyNiAwaC0zMC4zNzVjLTYuNTY4IDAtMTEuODkgNS4zMjctMTEuODkgMTEuODk0djg4LjE0M2MwIDQuNTczLTMuNjk3IDguMjktOC4yNyA4LjMxbC0yNy44ODUuMTMzYy00LjYxMi4wMjUtOC4zNTktMy43MTctOC4zNS04LjMyNWwuMTczLTg4LjI0MUM1NC4xNDQgNS4zMzcgNDguODE3IDAgNDIuMjQgMEgxMS44OUM1LjMyMSAwIDAgNS4zMjcgMCAxMS44OTRWMjYwLjIxYzAgNS44MzQgNC43MjYgMTAuNTYgMTAuNTU1IDEwLjU2SDI0NS40NGM1LjgzNCAwIDEwLjU2LTQuNzI2IDEwLjU2LTEwLjU2VjExOC44NjhjMC01LjgzNC00LjcyNi0xMC41Ni0xMC41Ni0xMC41NnptLTM5LjkwMiA5My4yMzNjMCA3LjY0NS02LjE5OCAxMy44NDQtMTMuODQzIDEzLjg0NEgxNjcuNjljLTcuNjQ2IDAtMTMuODQ0LTYuMTk5LTEzLjg0NC0xMy44NDR2LTI0LjAwNWMwLTcuNjQ2IDYuMTk4LTEzLjg0NCAxMy44NDQtMTMuODQ0aDI0LjAwNWM3LjY0NSAwIDEzLjg0MyA2LjE5OCAxMy44NDMgMTMuODQ0djI0LjAwNXonCiAgICAgICAgICBmaWxsPScjRjYwJy8+Cjwvc3ZnPg==" } -} +} \ No newline at end of file diff --git a/connectors/rabbitmq/element-templates/rabbitmq-outbound-connector.json b/connectors/rabbitmq/element-templates/rabbitmq-outbound-connector.json index 4a84c0d1eb..25221f6784 100644 --- a/connectors/rabbitmq/element-templates/rabbitmq-outbound-connector.json +++ b/connectors/rabbitmq/element-templates/rabbitmq-outbound-connector.json @@ -62,7 +62,11 @@ "description" : "URI should contain username, password, host name, port number, and virtual host", "optional" : false, "constraints" : { - "notEmpty" : true + "notEmpty" : true, + "pattern" : { + "value" : "^(amqps?://|secrets|\\{\\{).*$", + "message" : "Must start with amqp(s):// or contain a secret reference" + } }, "feel" : "optional", "group" : "authentication", diff --git a/connectors/rabbitmq/pom.xml b/connectors/rabbitmq/pom.xml index ba7d79494b..d224e47f45 100644 --- a/connectors/rabbitmq/pom.xml +++ b/connectors/rabbitmq/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 @@ -64,6 +64,27 @@ true + + io.camunda.connector.rabbitmq.inbound.RabbitMqExecutable + + + io.camunda.connectors.inbound.RabbitMQ.StartEvent.v1 + rabbitmq-inbound-connector-start-event.json + + + io.camunda.connectors.inbound.RabbitMQ.MessageStart.v1 + rabbitmq-inbound-connector-message-start.json + + + io.camunda.connectors.inbound.RabbitMQ.Intermediate.v1 + rabbitmq-inbound-connector-intermediate.json + + + io.camunda.connectors.inbound.RabbitMQ.Boundary.v1 + rabbitmq-inbound-connector-boundary.json + + + diff --git a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/FactoryRoutingData.java b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/FactoryRoutingData.java index b9d671bcec..0822d79dd2 100644 --- a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/FactoryRoutingData.java +++ b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/FactoryRoutingData.java @@ -15,6 +15,10 @@ public record FactoryRoutingData( @TemplateProperty( group = "routing", label = "Virtual host", + condition = + @TemplateProperty.PropertyCondition( + property = "authentication.authType", + equals = "credentials"), description = "Virtual name: get from RabbitMQ external application configurations. Details in the documentation") String virtualHost, @@ -22,6 +26,10 @@ public record FactoryRoutingData( @TemplateProperty( group = "routing", label = "Host name", + condition = + @TemplateProperty.PropertyCondition( + property = "authentication.authType", + equals = "credentials"), description = "Host name: get from RabbitMQ external application configurations. Details in the documentation") String hostName, @@ -29,6 +37,10 @@ public record FactoryRoutingData( @TemplateProperty( group = "routing", label = "Port", + condition = + @TemplateProperty.PropertyCondition( + property = "authentication.authType", + equals = "credentials"), description = "Port: get from RabbitMQ external application configurations. Details in the documentation") String port) {} diff --git a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/UriAuthentication.java b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/UriAuthentication.java index 05e45d4d41..9e40801263 100644 --- a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/UriAuthentication.java +++ b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/common/model/UriAuthentication.java @@ -9,10 +9,14 @@ import io.camunda.connector.generator.java.annotation.TemplateProperty; import io.camunda.connector.generator.java.annotation.TemplateSubType; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; @TemplateSubType(id = "uri", label = "URI") public record UriAuthentication( @NotBlank + @Pattern( + regexp = "^(amqps?://|secrets|\\{\\{).*$", + message = "Must start with amqp(s):// or contain a secret reference") @TemplateProperty( group = "authentication", label = "URI", diff --git a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/RabbitMqExecutable.java b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/RabbitMqExecutable.java index 59d8a4ca97..0232f0b361 100644 --- a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/RabbitMqExecutable.java +++ b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/RabbitMqExecutable.java @@ -13,6 +13,8 @@ import io.camunda.connector.api.inbound.Health; import io.camunda.connector.api.inbound.InboundConnectorContext; import io.camunda.connector.api.inbound.InboundConnectorExecutable; +import io.camunda.connector.generator.dsl.BpmnType; +import io.camunda.connector.generator.java.annotation.ElementTemplate; import io.camunda.connector.rabbitmq.inbound.model.RabbitMqInboundProperties; import io.camunda.connector.rabbitmq.supplier.ConnectionFactorySupplier; import java.io.IOException; @@ -23,16 +25,50 @@ import org.slf4j.LoggerFactory; @InboundConnector(name = "RabbitMQ Consumer", type = "io.camunda:connector-rabbitmq-inbound:1") -public class RabbitMqExecutable implements InboundConnectorExecutable { +@ElementTemplate( + id = "io.camunda.connectors.inbound.RabbitMQ", + name = "RabbitMQ Connector", + icon = "icon.svg", + version = 5, + inputDataClass = RabbitMqInboundProperties.class, + description = "Receive a message from RabbitMQ", + documentationRef = + "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rabbitmq/?rabbitmq=inbound", + propertyGroups = { + @ElementTemplate.PropertyGroup(id = "authentication", label = "Authentication"), + @ElementTemplate.PropertyGroup(id = "routing", label = "Routing"), + @ElementTemplate.PropertyGroup(id = "subscription", label = "Subscription"), + }, + elementTypes = { + @ElementTemplate.ConnectorElementType( + appliesTo = BpmnType.START_EVENT, + elementType = BpmnType.START_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.RabbitMQ.StartEvent.v1", + templateNameOverride = "RabbitMQ Start Event Connector"), + @ElementTemplate.ConnectorElementType( + appliesTo = BpmnType.START_EVENT, + elementType = BpmnType.MESSAGE_START_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.RabbitMQ.MessageStart.v1", + templateNameOverride = "RabbitMQ Message Start Event Connector"), + @ElementTemplate.ConnectorElementType( + appliesTo = {BpmnType.INTERMEDIATE_THROW_EVENT, BpmnType.INTERMEDIATE_CATCH_EVENT}, + elementType = BpmnType.INTERMEDIATE_CATCH_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.RabbitMQ.Intermediate.v1", + templateNameOverride = "RabbitMQ Intermediate Catch Event Connector"), + @ElementTemplate.ConnectorElementType( + appliesTo = BpmnType.BOUNDARY_EVENT, + elementType = BpmnType.BOUNDARY_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.RabbitMQ.Boundary.v1", + templateNameOverride = "RabbitMQ Boundary Event Connector") + }) +public class RabbitMqExecutable implements InboundConnectorExecutable { private static final Logger LOGGER = LoggerFactory.getLogger(RabbitMqExecutable.class); private static final int CLOSE_TIMEOUT_MILLIS = 3000; - + private final ConnectionFactorySupplier connectionFactorySupplier; private Connection connection; private Channel channel; private String consumerTag; // either provided in properties or generated by RabbitMQ server - private final ConnectionFactorySupplier connectionFactorySupplier; - public RabbitMqExecutable() { this.connectionFactorySupplier = new ConnectionFactorySupplier(); } diff --git a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/model/RabbitMqInboundProperties.java b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/model/RabbitMqInboundProperties.java index 1d3eb72b37..1ab26b1ae4 100644 --- a/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/model/RabbitMqInboundProperties.java +++ b/connectors/rabbitmq/src/main/java/io/camunda/connector/rabbitmq/inbound/model/RabbitMqInboundProperties.java @@ -6,6 +6,8 @@ */ package io.camunda.connector.rabbitmq.inbound.model; +import io.camunda.connector.generator.dsl.Property; +import io.camunda.connector.generator.java.annotation.TemplateProperty; import io.camunda.connector.rabbitmq.common.model.FactoryRoutingData; import io.camunda.connector.rabbitmq.common.model.RabbitMqAuthentication; import jakarta.validation.Valid; @@ -17,9 +19,38 @@ public class RabbitMqInboundProperties { @Valid @NotNull private RabbitMqAuthentication authentication; @Valid private FactoryRoutingData routing; - @NotBlank private String queueName; + + @NotBlank + @TemplateProperty( + label = "Queue name", + group = "subscription", + description = "Name of the queue to subscribe to") + private String queueName; + + @TemplateProperty( + label = "Consumer tag", + group = "subscription", + description = "Consumer tag to use for the subscription") private String consumerTag; - @Valid private Map arguments; + + @Valid + @TemplateProperty( + label = "Arguments", + description = "Arguments to use for the subscription", + group = "subscription", + optional = true, + feel = Property.FeelMode.required) + private Map arguments; + + @TemplateProperty( + label = "Exclusive consumer", + group = "subscription", + type = TemplateProperty.PropertyType.Dropdown, + choices = { + @TemplateProperty.DropdownPropertyChoice(value = "true", label = "Yes"), + @TemplateProperty.DropdownPropertyChoice(value = "false", label = "No") + }, + defaultValue = "false") private boolean exclusive; public RabbitMqAuthentication getAuthentication() {