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/13 11:40:29 UTC

[camel-kafka-connector] branch cassandraql-sink created (now 1411d6b)

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

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


      at 1411d6b  Camel-cassandraql sink example: Use localhost as default host

This branch includes the following new commits:

     new 6528090  Added a camel-cassandraql sink example
     new 6541477  Camel-cassandraql sink example: Added docs
     new 1411d6b  Camel-cassandraql sink example: Use localhost as default host

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel-kafka-connector] 03/03: Camel-cassandraql sink example: Use localhost as default host

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1411d6b3fbd0e3784cabd6d9973943e24276a9f0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 13 12:32:35 2019 +0100

    Camel-cassandraql sink example: Use localhost as default host
---
 examples/CamelCassandraQLSinkConnector.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/CamelCassandraQLSinkConnector.properties b/examples/CamelCassandraQLSinkConnector.properties
index 7f03186..e030f95 100644
--- a/examples/CamelCassandraQLSinkConnector.properties
+++ b/examples/CamelCassandraQLSinkConnector.properties
@@ -22,6 +22,6 @@ connector.class=org.apache.camel.kafkaconnector.CamelSinkConnector
 key.converter=org.apache.kafka.connect.storage.StringConverter
 value.converter=org.apache.kafka.connect.storage.StringConverter
 
-camel.sink.url=cql://172.17.0.2/test?cql=insert into users(id, name) values (now(), ?)
+camel.sink.url=cql://localhost/test?cql=insert into users(id, name) values (now(), ?)
 
 


[camel-kafka-connector] 01/03: Added a camel-cassandraql sink example

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6528090d7a06f15a446fd3e20770f53ed8dbbd21
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 13 12:30:05 2019 +0100

    Added a camel-cassandraql sink example
---
 examples/CamelCassandraQLSinkConnector.properties | 27 +++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/examples/CamelCassandraQLSinkConnector.properties b/examples/CamelCassandraQLSinkConnector.properties
new file mode 100644
index 0000000..7f03186
--- /dev/null
+++ b/examples/CamelCassandraQLSinkConnector.properties
@@ -0,0 +1,27 @@
+#
+# 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=CamelCassandraQLSinkConnector
+topics=mytopic
+tasks.max=1
+connector.class=org.apache.camel.kafkaconnector.CamelSinkConnector
+key.converter=org.apache.kafka.connect.storage.StringConverter
+value.converter=org.apache.kafka.connect.storage.StringConverter
+
+camel.sink.url=cql://172.17.0.2/test?cql=insert into users(id, name) values (now(), ?)
+
+


[camel-kafka-connector] 02/03: Camel-cassandraql sink example: Added docs

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6541477d41628244a4e966ecb894fb2a376f1735
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 13 12:32:10 2019 +0100

    Camel-cassandraql sink example: Added docs
---
 docs/try-it-out-locally.adoc | 57 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/docs/try-it-out-locally.adoc b/docs/try-it-out-locally.adoc
index b25f053..32b2c53 100644
--- a/docs/try-it-out-locally.adoc
+++ b/docs/try-it-out-locally.adoc
@@ -126,6 +126,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/CamelCassandraQLSourceConnector.properties
 ----
 
+.Run the cassandraql sink:
+
+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
+----
+
+You'll need a local installation of cassandra, in particular the 3.11.4.
+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 uuid primary key, name text );
+insert into users (id,name) values (now(), '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.sink.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/CamelCassandraQLSinkConnector.properties
+----
+
 .Run the file sink, just a camel file appending to /tmp/kafkaconnect.txt:
 [source,bash]
 ----