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

Infinispan Source Kamelet #180

Merged
merged 4 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -40,6 +40,7 @@
* xref:ROOT:google-sheets-source.adoc[image:kamelets/google-sheets-source.svg[] Google Sheets Source]
* xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink]
* xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source]
* xref:ROOT:infinispan-source.adoc[image:kamelets/infinispan-source.svg[] Infinispan Source]
* xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source]
* xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source]
* xref:ROOT:mail-imap-source.adoc[image:kamelets/mail-imap-source.svg[] Mail IMAP Source]
Expand Down
68 changes: 68 additions & 0 deletions docs/modules/ROOT/pages/infinispan-source.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/infinispan-source.svg[] Infinispan Source

*Provided by: "Apache Software Foundation"*

Get Events from an Infinispan cache

== Configuration Options

The following table summarizes the configuration options available for the `infinispan-source` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *hosts {empty}* *| Hosts| Specifies the host of the cache on Infinispan instance| String| `1000`|
| *password {empty}* *| Password| Password to connect to Infinispan.| string| |
| *username {empty}* *| Username| Username to connect to Infinispan.| string| |
| eventTypes| ElasticSearch cluster name| Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER| string| |
| saslMechanism| SASL Mechanism| The SASL Mechanism to use| String| `"DIGEST-MD5"`|
| secure| Secure| If the Infinispan instance is secured or not| boolean| `true`|
| securityRealm| Security Realm| Define the security realm to access the infinispan instance| string| `"default"`|
| securityServerName| Security Server name| Define the security server name to access the infinispan instance| string| `"infinispan"`|
|===

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

== Usage

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

=== Knative Source

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

.infinispan-source-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: infinispan-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: infinispan-source
properties:
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 `infinispan-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 infinispan-source-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
80 changes: 80 additions & 0 deletions infinispan-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: infinispan-source
labels:
camel.apache.org/kamelet.type: "source"
annotations:
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyBp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jU0QTgxLjkyLDgxLjkyLDAsMCwwLDEwOS43Myw1Ny44LDg4LjUyLDg4LjUyLDAsMCwxLDEyMSw4My43MVoiLz48L3N2Zz4="
spec:
sources:
- content: |-
public class InfinispanWorkaround extends org.apache.camel.builder.RouteBuilder {
@Override
public void configure() throws Exception {
getContext().setAutowiredEnabled(false);
}
}
name: InfinispanWorkaround.java
definition:
title: "Infinispan Source"
description: |-
Get Events from an Infinispan cache
required:
- hosts
- username
- password
- hostAddresses
properties:
hosts:
title: Hosts
description: Specifies the host of the cache on Infinispan instance
type: String
default: 1000
oscerd marked this conversation as resolved.
Show resolved Hide resolved
secure:
title: Secure
description: If the Infinispan instance is secured or not
type: boolean
default: true
username:
title: Username
description: Username to connect to Infinispan.
type: string
password:
title: Password
description: Password to connect to Infinispan.
type: string
saslMechanism:
title: SASL Mechanism
description: The SASL Mechanism to use
type: String
default: "DIGEST-MD5"
securityRealm:
title: Security Realm
description: Define the security realm to access the infinispan instance
type: string
default: "default"
securityServerName:
title: Security Server name
description: Define the security server name to access the infinispan instance
type: string
default: "infinispan"
eventTypes:
title: ElasticSearch cluster name
description: Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER
type: string
flow:
from:
uri: "kamelet-reify:infinispan:{{cacheName}}"
parameters:
hosts: "{{hosts}}"
secure: "{{secure}}"
username: "{{username}}"
password: "{{password}}"
saslMechanism: "{{saslMechanism}}"
securityRealm: "{{securityRealm}}"
securityServerName: "{{securityServerName}}"
eventTypes: "{{eventTypes}}"
steps:
- to: kamelet:sink
oscerd marked this conversation as resolved.
Show resolved Hide resolved