This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/camel-kafka-connector-examples.git
The following commit(s) were added to refs/heads/master by this push:
new 64d2cef Add AMQP source and sink examples
new 8a52b32 Merge pull request #8 from rgannu/master
64d2cef is described below
commit 64d2cef93f3ad2a4d5e03bf517ab80e1a6be2df0
Author: Ganesh Ramasubramanian <[email protected]>
AuthorDate: Tue Jun 9 16:37:01 2020 +0200
Add AMQP source and sink examples
Added AMQP source and sink examples
---
README.adoc | 1 +
amqp/README.md | 66 +++++++++++++++++++++++++
amqp/config/CamelAmqpSinkConnector.properties | 31 ++++++++++++
amqp/config/CamelAmqpSourceConnector.properties | 31 ++++++++++++
4 files changed, 129 insertions(+)
diff --git a/README.adoc b/README.adoc
index 836f47f..e232e48 100644
--- a/README.adoc
+++ b/README.adoc
@@ -7,3 +7,4 @@ List of existing examples:
- aws2-sqs source and sink examples
- cql source and sink example
- file source and sink example
+- amqp source and sink example
diff --git a/amqp/README.md b/amqp/README.md
new file mode 100644
index 0000000..742befd
--- /dev/null
+++ b/amqp/README.md
@@ -0,0 +1,66 @@
+# Camel-Kafka-connector Kafka to AMQP broker demo
+
+## Introduction
+
+This is an example for Camel-Kafka-connector
+
+## What is needed
+
+- An Artemis Broker 2.9.0 running
+- A Kafka Cluster 2.4.0 running
+- Apache Qpid JMS client
+
+## Running Kafka
+
+```
+$KAFKA_HOME/bin/zookeeper-server-start.sh config/zookeeper.properties
+$KAFKA_HOME/bin/kafka-server-start.sh config/server.properties
+$KAFKA_HOME/bin/kafka-topics.sh --create --bootstrap-server localhost:9092
--replication-factor 1 --partitions 1 --topic mytopic
+```
+
+## Running Artemis
+
+```
+$ARTEMIS_HOME/bin/$BROKER_NAME/bin/artemis run
+```
+
+## Setting up the needed bits and running the example
+
+You'll need to setup the plugin.path property in your kafka
+
+Open the `$KAFKA_HOME/config/connect-standalone.properties`
+
+and set the `plugin.path` property to your choosen location
+
+In this example we'll use `/home/oscerd/connectors/`
+
+```
+> cd /home/oscerd/connectors/
+> wget
https://repo1.maven.org/maven2/org/apache/camel/kafkaconnector/camel-amqp-kafka-connector/0.2.0/camel-amqp-kafka-connector-0.2.0-package.zip
+> unzip camel-amqp-kafka-connector-0.2.0-package.zip
+> wget
https://downloads.apache.org/qpid/jms/0.51.0/apache-qpid-jms-0.51.0-bin.tar.gz
+> tar -xzvf apache-qpid-jms-0.51.0-bin.tar.gz
+```
+
+Now you can run the example
+
+```
+$KAFKA_HOME/bin/connect-standalone.sh
$KAFKA_HOME/config/connect-standalone.properties
config/CamelAmqpSourceConnector.properties
config/CamelAmqpSinkConnector.properties
+```
+
+Just connect to your Kafka
+- Produce some sample kafka messages
+```bash
+$KAFKA_HOME/bin/kafka-console-producer.sh --bootstrap-server kafka:9092
--topic mytopic
+>Test Message-1
+>Test Message-2
+Ctrl+C
+```
+- Check with the kafka console consumer that the messages are available in the
kafka topic.
+```bash
+$KAFKA_HOME/bin/kafka-console-consumer.sh --bootstrap-server kafka:9092
--topic mytopic --from-beginning
+Test Message-1
+Test Message-2
+Ctrl+C
+```
+
diff --git a/amqp/config/CamelAmqpSinkConnector.properties
b/amqp/config/CamelAmqpSinkConnector.properties
new file mode 100644
index 0000000..1061356
--- /dev/null
+++ b/amqp/config/CamelAmqpSinkConnector.properties
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name=CamelAmqpSinkConnector
+topics=mytopic
+tasks.max=1
+connector.class=org.apache.camel.kafkaconnector.amqp.CamelAmqpSinkConnector
+
+camel.sink.path.destinationType=queue
+camel.sink.path.destinationName=test-queue
+
+camel.component.amqp.includeAmqpAnnotations=true
+camel.component.amqp.connectionFactory=#class:org.apache.qpid.jms.JmsConnectionFactory
+camel.component.amqp.connectionFactory.remoteURI=amqp://localhost:5672
+camel.component.amqp.username=admin
+camel.component.amqp.password=admin
+camel.component.amqp.testConnectionOnStartup=true
diff --git a/amqp/config/CamelAmqpSourceConnector.properties
b/amqp/config/CamelAmqpSourceConnector.properties
new file mode 100644
index 0000000..2ed871b
--- /dev/null
+++ b/amqp/config/CamelAmqpSourceConnector.properties
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name=CamelAmqpSourceConnector
+topics=mytopic
+tasks.max=1
+connector.class=org.apache.camel.kafkaconnector.amqp.CamelAmqpSourceConnector
+
+camel.sink.path.destinationType=queue
+camel.sink.path.destinationName=test-queue
+
+camel.component.amqp.includeAmqpAnnotations=true
+camel.component.amqp.connectionFactory=#class:org.apache.qpid.jms.JmsConnectionFactory
+camel.component.amqp.connectionFactory.remoteURI=amqp://localhost:5672
+camel.component.amqp.username=admin
+camel.component.amqp.password=admin
+camel.component.amqp.testConnectionOnStartup=true