Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ source kamelet #46

Merged
merged 3 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* xref:ROOT:minio-source.adoc[image:kamelets/minio-source.svg[] Minio Source]
* xref:ROOT:mqtt-source.adoc[image:kamelets/mqtt-source.svg[] MQTT Source]
* xref:ROOT:nats-source.adoc[image:kamelets/nats-source.svg[] NATS Source]
* xref:ROOT:rabbitmq-source.adoc[image:kamelets/rabbitmq-source.svg[] RabbitMQ Source]
* xref:ROOT:salesforce-source.adoc[image:kamelets/salesforce-source.svg[] Salesforce Source]
* xref:ROOT:sftp-source.adoc[image:kamelets/sftp-source.svg[] SFTP Source]
* xref:ROOT:slack-source.adoc[image:kamelets/slack-source.svg[] Slack Source]
Expand Down
67 changes: 67 additions & 0 deletions docs/modules/ROOT/pages/rabbitmq-source.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/rabbitmq-source.svg[] RabbitMQ Source

*Provided by: "Apache Software Foundation"*

Receive data from an RabbitMQ Brokers.

== Configuration Options

The following table summarizes the configuration options available for the `rabbitmq-source` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *addresses {empty}* *| Addresses| Comma separated list of RabbitMQ broker addresses| string| |
| *exchangeName {empty}* *| Exchange name| The exchange name determines the exchange the queue will be bound to| string| |
| *password {empty}* *| Password| The password to access the RabbitMQ server| string| |
| *username {empty}* *| Username| The username to access the RabbitMQ server| string| |
| port| Port| Port of the RabbitMQ server| string| `5672`|
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `rabbitmq-source` can be used in various contexts.

=== Knative Source

The `rabbitmq-source` Kamelet can be used as Knative source by binding it to a Knative object.

.rabbitmq-source-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: rabbitmq-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: rabbitmq-source
properties:
addresses: "The Addresses"
exchangeName: "The Exchange name"
password: "The Password"
username: "The Username"
sink:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: mychannel

----

Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `rabbitmq-source-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

[source,shell]
----
kubectl apply -f rabbitmq-source-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
54 changes: 54 additions & 0 deletions rabbitmq-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: rabbitmq-source
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjcxcHgiIGhlaWdodD0iMjcxcHgiIHZpZXdCb3g9Ii03LjUgMCAyNzEgMjcxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj48cGF0aCBkPSJNMjQ1LjQ0IDEwOC4zMDhoLTg1LjA5YTcuNzM4IDcuNzM4IDAgMCAxLTcuNzM1LTcuNzM0di04OC42OEMxNTIuNjE1IDUuMzI3IDE0Ny4yOSAwIDE0MC43MjYgMGgtMzAuMzc1Yy02LjU2OCAwLTExLjg5IDUuMzI3LTExLjg5IDExLjg5NHY4OC4xNDNjMCA0LjU3My0zLjY5NyA4LjI5LTguMjcgOC4zMWwtMjcuODg1LjEzM2MtNC42MTIuMDI1LTguMzU5LTMuNzE3LTguMzUtOC4zMjVsLjE3My04OC4yNDFDNTQuMTQ0IDUuMzM3IDQ4LjgxNyAwIDQyLjI0IDBIMTEuODlDNS4zMjEgMCAwIDUuMzI3IDAgMTEuODk0VjI2MC4yMWMwIDUuODM0IDQuNzI2IDEwLjU2IDEwLjU1NSAxMC41NkgyNDUuNDRjNS44MzQgMCAxMC41Ni00LjcyNiAxMC41Ni0xMC41NlYxMTguODY4YzAtNS44MzQtNC43MjYtMTAuNTYtMTAuNTYtMTAuNTZ6bS0zOS45MDIgOTMuMjMzYzAgNy42NDUtNi4xOTggMTMuODQ0LTEzLjg0MyAxMy44NDRIMTY3LjY5Yy03LjY0NiAwLTEzLjg0NC02LjE5OS0xMy44NDQtMTMuODQ0di0yNC4wMDVjMC03LjY0NiA2LjE5OC0xMy44NDQgMTMuODQ0LTEzLjg0NGgyNC4wMDVjNy42NDUgMCAxMy44NDMgNi4xOTggMTMuODQzIDEzLjg0NHYyNC4wMDV6IiBmaWxsPSIjRjYwIi8+PC9zdmc+"
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "RabbitMQ Source"
description: |-
Receive data from an RabbitMQ Brokers.
required:
- addresses
- exchangeName
- username
- password
properties:
addresses:
title: Addresses
description: Comma separated list of RabbitMQ broker addresses
type: string
port:
title: Port
description: Port of the RabbitMQ server
type: string
default: 5672
username:
title: Username
description: The username to access the RabbitMQ server
type: string
password:
title: Password
description: The password to access the RabbitMQ server
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
exchangeName:
title: Exchange name
description: The exchange name determines the exchange the queue will be bound to
type: string
flow:
from:
uri: "rabbitmq://{{exchangeName}}"
parameters:
password: "{{password}}"
username: "{{username}}"
addresses: "{{addresses}}"
steps:
- convert-body-to:
type: "java.lang.String"
oscerd marked this conversation as resolved.
Show resolved Hide resolved
- to: "kamelet:sink"