You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/12/12 18:57:57 UTC

[camel-kafka-connector] 02/03: Added detailed instructions on how to run the example for camel-cassandraql source connector

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch cassandraql-source
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 97209d8fc92053ad8e0ad30c782ff2d3fd383893
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 12 19:53:29 2019 +0100

    Added detailed instructions on how to run the example for camel-cassandraql source connector
---
 docs/try-it-out-locally.adoc | 59 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/docs/try-it-out-locally.adoc b/docs/try-it-out-locally.adoc
index 5141669..67b0b3b 100644
--- a/docs/try-it-out-locally.adoc
+++ b/docs/try-it-out-locally.adoc
@@ -69,6 +69,63 @@ export CLASSPATH="$(find core/target/ -type f -name '*.jar'| grep '\-package' |
 $KAFKA_HOME/bin/connect-standalone.sh $KAFKA_HOME/config/connect-standalone.properties examples/CamelTelegramSourceConnector.properties
 ----
 
+.Run the cassandraql source:
+Change your telegram bot token in `examples/CamelCassandraQLSourceConnector.properties`
+
+To run this example you'll need a bit more work:
+
+First you'll need to run a cassandra instance:
+
+[source,bash]
+----
+docker run --name master_node --env MAX_HEAP_SIZE='800M' -dt oscerd/cassandra
+----
+
+Check everything is fine:
+
+[source,bash]
+----
+docker exec -ti master_node /opt/cassandra/bin/nodetool status
+Datacenter: datacenter1
+=======================
+Status=Up/Down
+|/ State=Normal/Leaving/Joining/Moving
+--  Address     Load       Tokens       Owns (effective)  Host ID                               Rack
+UN  172.17.0.2  251.32 KiB  256          100.0%            5126aaad-f143-43e9-920a-0f9540a93967  rack1
+----
+
+Now we can populate the database:
+
+[source,bash]
+----
+<LOCAL_CASSANDRA_HOME>/bin/cqlsh $(docker inspect --format='{{ .NetworkSettings.IPAddress }}' master_node)
+----
+
+and run the script:
+
+[source,bash]
+----
+create keyspace test with replication = {'class':'SimpleStrategy', 'replication_factor':3};
+use test;
+create table users ( id int primary key, name text );
+insert into users (id,name) values (1, 'oscerd');
+quit;
+----
+
+The output of the following command should be used in the configuration of CamelCassandraQLSourceConnector.properties
+
+[source,bash]
+----
+<LOCAL_CASSANDRA_HOME>/bin/cqlsh $(docker inspect --format='{{ .NetworkSettings.IPAddress }}' master_node)
+----
+
+in particular it should be used as address instead of localhost in the `camel.source.url`
+[source,bash]
+----
+export CLASSPATH="$(find core/target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
+$KAFKA_HOME/bin/connect-standalone.sh $KAFKA_HOME/config/connect-standalone.properties examples/CamelCassandraQLSourceConnector.properties
+----
+
 .Run the file sink, just a camel file appending to /tmp/kafkaconnect.txt:
 [source,bash]
 ----
@@ -168,4 +225,4 @@ $KAFKA_HOME/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --to
 [source,bash]
 ----
 $KAFKA_HOME/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic mytopic
-----
\ No newline at end of file
+----