Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C3A1B200C87 for ; Wed, 17 May 2017 09:25:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C2152160BBA; Wed, 17 May 2017 07:25:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 13DAE160BB5 for ; Wed, 17 May 2017 09:25:51 +0200 (CEST) Received: (qmail 59548 invoked by uid 500); 17 May 2017 07:25:46 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 59531 invoked by uid 99); 17 May 2017 07:25:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2017 07:25:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9EB661A0474 for ; Wed, 17 May 2017 07:25:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.174 X-Spam-Level: ** X-Spam-Status: No, score=2.174 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id PA8uTkki74py for ; Wed, 17 May 2017 07:25:42 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4F3995FD47 for ; Wed, 17 May 2017 07:25:41 +0000 (UTC) Received: from static.162.255.23.37.macminivault.com (unknown [162.255.23.37]) by mwork.nabble.com (Postfix) with ESMTP id BE11F425059BE for ; Wed, 17 May 2017 00:25:40 -0700 (MST) Date: Wed, 17 May 2017 00:25:40 -0700 (MST) From: blasteralfred To: user@ignite.apache.org Message-ID: <1495005940755-12959.post@n6.nabble.com> Subject: How to set cache name in Kafka connect? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Wed, 17 May 2017 07:25:53 -0000 Hi, I am trying to fetch from Kafka topic to Ignite cache. I am a beginner and created a code for the same. I don't know how to set Cache name. Also, kindly review my code that is there any mistakes, which will be really helpful for me to get started with these. Thanks in advance.. Ignition.setClientMode(true); try (Ignite ignite = Ignition.start("D:/Applns/apache-ignite-fabric-1.6.0-bin/apache-ignite-fabric-1.6.0-bin/examples/config/example-ignite.xml")) { KafkaStreamer kafkaStreamer = new KafkaStreamer<>(); try (IgniteDataStreamer stmr = ignite.dataStreamer(null)) { stmr.allowOverwrite(true); CacheConfiguration cfg = new CacheConfiguration<>(); cfg.setName("Democache"); IgniteCache cache = ignite.getOrCreateCache(cfg); kafkaStreamer.setIgnite(ignite); kafkaStreamer.setStreamer(stmr); kafkaStreamer.setTopic("cachetest3"); kafkaStreamer.setThreads(4); Properties settings = new Properties(); settings.put("bootstrap.servers", "192.168.15.120:9092"); settings.put("group.id", "test"); settings.put("zookeeper.connect", "192.168.15.120:2181"); settings.put("key.serializer","org.apache.kafka.common.serialization.StringSerializer"); settings.put("key.deserializer","org.apache.kafka.common.serialization.StringDeserializer"); settings.put("value.serializer","org.apache.kafka.common.serialization.StringSerializer"); settings.put("value.deserializer","org.apache.kafka.common.serialization.StringDeserializer"); kafka.consumer.ConsumerConfig config = new ConsumerConfig(settings); kafkaStreamer.setConsumerConfig(config); StringDecoder strDecoder = new StringDecoder(new VerifiableProperties()); kafkaStreamer.setKeyDecoder(strDecoder); kafkaStreamer.setValueDecoder(strDecoder); kafkaStreamer.start(); } finally { kafkaStreamer.stop(); } } IgniteStream.java -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-set-cache-name-in-Kafka-connect-tp12959.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.