This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
zookeeper: | |
image: wurstmeister/zookeeper | |
networks: | |
- broker-kafka | |
container_name: zookeeper | |
ports: | |
- "2181:2181" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'kafka' | |
# Set up Kafka client | |
kafka = Kafka.new( | |
seed_brokers: ['localhost:9092'], | |
client_id: 'my_kafka_client' | |
) | |
# Create a producer | |
producer = kafka.producer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ps_out=`ps -ef | grep $1 | grep -v 'grep' | grep -v $0` | |
result=$(echo $ps_out | grep "$1") | |
if [[ "$result" != "" ]];then | |
echo "Running" | |
else | |
echo "Not Running" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
zookeeper: | |
image: wurstmeister/zookeeper:3.4.6 | |
ports: | |
- "2181:2181" | |
kafka: | |
image: wurstmeister/kafka | |
ports: | |
- "9092:9092" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Eclipse | IntelliJ IDEA | Descrição | |
---|---|---|---|
F4 | ctrl+h | Mostra o tipo de hierarquias | |
ctrl+alt+g | ctrl+alt+F7 | Procura utilizações | |
ctrl+shift+u | ctrl+f7 | Procura utilizações no mesmo arquivo | |
alt+shift+r | shift+F6 | Renomeia | |
ctrl+shift+r | ctrl+shift+N | Procura arquivos | abre resources | |
ctrl+shift+x j | ctrl+shift+F10 | Executa um Java program | |
ctrl+shift+o | ctrl+alt+o | Organiza os imports do seu código | |
ctrl+o | ctrl+F12 | Mostra a Estrutura|Objeto|Função Atual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
var wg sync.WaitGroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
generator := func(done <-chan interface{}, integers ...int) <-chan int { | |
intStream := make(chan int) | |
go func() { | |
defer close(intStream) | |
for _, i := range integers { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
c1 := make(chan interface{}) | |
close(c1) | |
c2 := make(chan interface{}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
chanOwner := func() <-chan int { | |
resultStream := make(chan int, 5) | |
go func() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
c := sync.NewCond(&sync.Mutex{}) |
NewerOlder