#Using wireshark to sniff kafka messages
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt-get update
sudo apt-get install wireshark
import org.apache.kafka.streams.kstream.KGroupedStream | |
import org.apache.kafka.streams.kstream.KStream | |
import org.springframework.stereotype.Component | |
import org.springframework.cloud.stream.annotation.StreamListener | |
@Component | |
class CurrencyProcessing { | |
@StreamListener | |
fun processCurrency(input: KStream<String, Double>) { |
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-two --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance --print-metrics --topic test-rep-one --num-records 6000000 --throughput 100000 --record-size 100 --producer-props bootstrap.servers=kafka_host:9092 buffer.memory=67108864 batch.size=8196 | |
Single-thread, async 3x replication |
/* The MIT License (MIT) | |
* Copyright (c) 2012 Carl Eriksson | |
* | |
* Permission is hereby granted, free of charge, to any person obtaininga | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction,including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the Software | |
* is furnished to do so, subject to the following conditions: | |
* |
# a comma separated list of the the ccloud broker endpoints. e.g. | |
bootstrap.servers=r0.great-app.confluent.aws.prod.cloud:9092,r1.great-app.confluent.aws.prod.cloud:9093,r2.great-app.confluent.aws.prod.cloud:9094 | |
ksql.sink.replicas=3 | |
replication.factor=3 | |
security.protocol=SASL_SSL | |
sasl.mechanism=PLAIN | |
sasl.jaas.config=\ | |
org.apache.kafka.common.security.plain.PlainLoginModule required \ | |
username="<confluent cloud access key>" \ | |
password="<confluent cloud secret>"; |
package com.nyjavasig.how.hazelcast.demo; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.LineNumberReader; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.regex.Pattern; | |
public class WordUtil { |
<?xml version="1.0" encoding="UTF-8"?> | |
<hazelcast | |
xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-3.8.xsd" | |
xmlns="http://www.hazelcast.com/schema/config" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
</hazelcast> |
package com.hazelcast.zookeeper; | |
import org.apache.curator.framework.CuratorFramework; | |
import org.apache.curator.framework.CuratorFrameworkFactory; | |
import org.apache.curator.retry.ExponentialBackoffRetry; | |
import org.apache.curator.x.discovery.ServiceDiscovery; | |
import org.apache.curator.x.discovery.ServiceDiscoveryBuilder; | |
import org.apache.curator.x.discovery.ServiceInstance; |
Set<Integer> set = new HashSet<>(Arrays.asList(1,2,3,4,5)) | |
System.out.println(set); | |
/exit |
Asciidoctor EPUB3 1.5.0.dev using Asciidoctor 1.5.3 [http://asciidoctor.org] | |
Runtime Environment (ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin13.3.0]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8) | |
/usr/local/Cellar/rbenv/0.4.0/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/asciidoctor-epub3-1.5.0.dev/lib/asciidoctor-epub3/converter.rb:336:in `listing': undefined method `gsub' for nil:NilClass (NoMethodError) | |
from /usr/local/Cellar/rbenv/0.4.0/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/asciidoctor-epub3-1.5.0.dev/lib/asciidoctor-epub3/converter.rb:89:in `convert' | |
from /usr/local/opt/rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:71:in `convert' | |
from /usr/local/opt/rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in `block in content' | |
from /usr/local/opt/rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in `map' | |
from /usr/local/opt/rbenv/ |