Giter VIP home page Giter VIP logo

connector-rabbitmq's Introduction

This repository was archived and transferred to https://github.com/camunda/connectors-bundle.

Camunda RabbitMQ Connector

Find the user documentation in our Camunda Platform 8 Docs.

Build

mvn clean package

API

Input

{
  "authentication": {
    "authType": "credentials",
    "userName": "secrets.USERNAME",
    "password": "secrets.PASSWORD"
  },
  "routing": {
    "exchange": "exchangeName",
    "routingKey": "routingKey",
    "virtualHost": "virtualHostName",
    "hostName": "localhost",
    "port": "5672"
  },
  "message": {
    "body": {"messageBodyKey": "value"},
    "properties": {
      "contentType":"text/plan",
      "headers": {
        "key": "value",
        "key2":"value2"
      }
    }
  }
}
{
  "authentication": {
    "authType": "uri",
    "uri": "amqp://userName:password@localhost:5672/virtualHostName"
  },
  "routing": {
    "exchange": "exchange",
    "routingKey": "routingKey"
  },
  "message": {
    "properties": {
      "contentType":"text/plan",
      "headers": {
        "key": "value"
      }
    },
    "body": "some data for send"
  }
}

Output

{
  "result": {
    "statusResult": "success"
  }
}

Test locally

Run unit tests

mvn clean verify

Test as local Job Worker

Use the Camunda Connector Runtime to run your function as a local Job Worker.

🔒 Test as local Google Cloud Function

Warning This is Camunda-internal only. The Maven profile cloud-function accesses an internal artifact.

Build as Google Cloud Function

mvn function:run -Pcloud-function

See also the 🔒Camunda Cloud Connector Run-Time on how your function is run as a Google Cloud Function.

Element Template

The element templates can be found in the element-templates/template-connector.json file.

Build a release

Trigger the release action manually with the version x.y.z you want to release and the next SNAPSHOT version.

connector-rabbitmq's People

Contributors

chillleader avatar github-actions[bot] avatar igpetrov avatar markfarkas-camunda avatar mbiciin avatar oleksiivanov avatar tmetzke avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

skayliu

connector-rabbitmq's Issues

Create an environment or docker container with RabbitMQ server

What should we do?

Create more comfortable testing for RabbitMQ and prepare conditions for other connectors with the required installed server.

Why should we do it?

For testing RabbitMq Connector (#15) QA needs log in with their own account at https://www.cloudamqp.com/ and create rabbitMQ server instance.
In this case, all testing data is available only for one QA engineer.
What can we do?
We can use one account and one rabbitMQ server for QA teams and for Connector teams,
OR we can create a docker container in camunda remote server with RabbitMq server and with already installed testing data in this server, and start it when needed.
We can use the case with docker and for other connectors, and all QA teams, Connector teams, and others will know all test credentials and will be able to start RabbitMq server in one-two click and to do regression testing and just testing for needed Connector more quickly.

[RabbitMQ] [Discover] RabbitMq MVP for producer and consumer

What should we do?

  • Discover MVP to push RabbitMq message
  • Discover MVP to pull RabbitMq message
  • Dive deep into realistic use-cases: real architectures, authn/z

Authentication Mechanisms

RabbitMQ supports multiple SASL authentication mechanisms. There are three such mechanisms built into the server: PLAIN, AMQPLAIN, and RABBIT-CR-DEMO, and one — EXTERNAL — available as a plugin.

More authentication mechanisms can be provided by plugins. See the plugin development guide for more information on general plugin development.

Mechanism Description
PLAIN SASL PLAIN authentication. This is enabled by default in the RabbitMQ server and clients, and is the default for most other clients.
AMQPLAIN Non-standard version of PLAIN retained for backwards compatibility. This is enabled by default in the RabbitMQ server.
EXTERNAL Authentication happens using an out-of-band mechanism such as x509 certificate peer verification, client IP address range, or similar. Such mechanisms are usually provided by RabbitMQ plugins.
RABBIT-CR-DEMO Non-standard mechanism which demonstrates challenge-response authentication. This mechanism has security equivalent to PLAIN, and is not enabled by default in the RabbitMQ server.

RabbitMQ supports multiple SASL authentication mechanisms. There are three such mechanisms built into the server: PLAIN, AMQPLAIN, and RABBIT-CR-DEMO, and one — EXTERNAL — available as a plugin.

More authentication mechanisms can be provided by plugins. See the plugin development guide for more information on general plugin development.

Authentication, Authorisation

Two primary ways of authenticating a client are username/password pairs and X.509 certificates. Username/password pairs can be used with a variety of authentication backends that verify the credentials.

OAuth 2 Support
The client can authenticate against an OAuth 2 server like UAA. The OAuth 2 plugin must be enabled on the server side and configured to use the same OAuth 2 server as the client.

But usually, people use only username/password pairs and for the first version RabbitMq connector it will be easier

Requered fields, Connection with Java

In this way, (use username/password pairs ) we have two main connecting types to RabbitMQ :
Connecting to RabbitMQ using the given parameters

Property Default Value
Username "guest"
Password "guest"
Virtual host "/"
Hostname "localhost"
port 5672 for regular connections, 5671 for connections that use TLS

And Connecting Using a URI
URIs may be used:
Example URI : amqp://userName:password@hostName:portNumber/virtualHost

RabbitMq Consumers

Consumers consume from queues. In order to consume messages there has to be a queue. When a new consumer is added, assuming there are already messages ready in the queue, deliveries will start immediately.
Java client guide. Receiving Messages by Subscription ("Push API")

Publishing Messages

(Publisher guide)

Fields for publish message:

exchange (required) – the exchange to publish the message to
routingKey (or can be queue name) (required)– the routing key
properties (optional) – other properties for the message - routing headers etc
body (required) – the message body

Failed to invoke connector

Describe the Bug

Steps to Reproduce

  1. log in to modeler,
  2. Create a new project
  3. Create/ Append RabbitMQ connector
  4. fill required fields :
    URI: amqps://ctlijyci:[email protected]/ctlijyci
    Routing : {"routingKey":"routingKey","exchange":"demo-exchange"}
    Message : {"key":"value}
    Propperties: {}
    Result Variable: result
  5. deploy diagramm
  6. start instance
  7. go to operate
  8. we see error : Failed to invoke connector, received the following error: Content type 'text/html' not supported for bodyType=io.camunda.connectorbridge.invoker.ConnectorInvokerResponse

Screenshot 2022-11-11 at 14 16 46

Expected Behavior
Instance should be executed without error

Environment

Unsupported property - Error message have a format issue since the message shows a &#39

Describe the Bug

If a user introduce a property that is not supported by RabbitMQ, the error message displayed on Operate contains an error format for the apostrophe. The message is display as: Failed to invoke connector, received the following error: Unsupported field 'contentEnconding' for properties

List of properties supported by RabbitMQ: https://www.rabbitmq.com/publishers.html#message-properties

Steps to Reproduce

  1. Create a BPM diagram
  2. Add a start process
  3. Add a RabbitMQ process
  4. Add an end process
  5. On the RabbitMQ process, add all the necessary information and on the Message - properties field add the following property:
    {contentEnconding: "UTF-8"}
  6. Deploy and Start an instance.
  7. Go to the instance and wait for the error to show.

Expected Behavior

The error message should read as: Failed to invoke connector, received the following error: Unsupported field 'contentEnconding' for properties

Looks like the root cause is on this line

Environment

[RabbitMQ] create a new SDK Function/RabbitMqConnector

Username/Password Auth - Not able to connect to the instance due to "Failed to invoke connector" error

Describe the Bug

If a user use the username/password authentication method, the RabbitMQ connector fails to sent the message to the instance showing an error message on Operate. Even after saving the username/password as secrets on the cluster, it stills fails with the same error.

Steps to Reproduce

  1. Create a BPM diagram
  2. Add a start process
  3. Add a RabbitMQ process
  4. Add an end process
  5. On the RabbitMQ process, add all the necessary information making sure you use the username/password authentication method.
  6. Deploy and Start an instance.
  7. Go to the instance on Operate and wait for the error to show.

An error message says: Failed to invoke connector, received the following error: https://stingray.rmq.cloudamqp.com but nothing else.

Expected Behavior

Message should be sent out to RabbitMQ.

Environment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.