- Kotlinを使って単純なテキストを受け取って送信する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
/* | |
* This file was generated by the Gradle 'init' task. | |
* | |
* This generated file contains a sample Kotlin application project to get you started. | |
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle | |
* User Manual available at https://docs.gradle.org/7.2/userguide/building_java_projects.html | |
*/ | |
plugins { | |
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. |
遊びで使っている、MacBook Air (M1, 2020) メモリ 8GBの環境でKafkaを使ったアプリケーションを作ろうとしていた。 Kafka環境構築のために、当初はk8sを使おうとしていたのだが、メモリ不足で立ち上げることができなかった。 次にdocker composeを利用することも考えたが、興味の対象はKafkaの運用ではなく、Kafkaで実行されるアプリケーションにあったので、とりあえずOSX上で直接Kafkaを動かすことにした。 あくまで開発用のため、レプリケーションの設定も含めて適当である。
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
# How to run Kafka using helm | |
2021-09-02 | |
## Prerequisite | |
- local kubernetes cluster | |
- helm | |
- https://helm.sh/docs/intro/install/ |
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 dynamodb | |
import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded | |
import com.amazonaws.services.dynamodbv2.model.* | |
import software.amazon.awssdk.services.dynamodb.model.GetItemRequest | |
import software.amazon.awssdk.services.dynamodb.model.AttributeValue | |
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient | |
import kotlin.test.Test |
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 ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"os/exec" | |
"strings" | |
"sync" |
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
[[plugins]] | |
repo = 'Shougo/dein.vim' | |
[[plugins]] # Japanese doc | |
repo = 'vim-jp/vimdoc-ja' | |
hook_add = ''' | |
set helplang=ja,en | |
''' | |
[[plugins]] |
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
# using docker https://github.com/Ragnaroek/rust-on-raspberry-docker | |
# | |
# requirement | |
# - cargo (this Makefile for a cargo project) | |
# - docker | |
# - jq (for getting metadata of a project) | |
# - scp (for deploying) | |
IMAGE_VERSION=1.18.0 | |
PROJECT_NAME = $(shell cargo metadata --format-version=1 --no-deps | jq -r .packages[0].name) |
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
$ cargo init --bin ferris | |
$ cd ferris | |
$ ls | |
Cargo.lock Cargo.toml src | |
$ cargo metadata --format-version=1 | |
{"packages":[{"name":"ferris","version":"0.1.0","id":"ferris 0.1.0 (path+file:///path/to/ferris)","license":null,"license_file":null,"description":null,"source":null,"dependencies":[],"targets":[{"kind":["bin"],"crate_types":["bin"],"name":"ferris","src_path":"/path/to/ferris/src/main.rs"}],"features":{},"manifest_path":"/path/to/ferris/Cargo.toml"}],"workspace_members":["ferris 0.1.0 (path+file:///path/to/ferris)"],"resolve":{"nodes":[{"id":"ferris 0.1.0 (path+file:///path/to/ferris)","dependencies":[]}],"root":"ferris 0.1.0 (path+file:///path/to/ferris)"},"target_directory":"/path/to/ferris/target","version":1} | |
$ cargo metadata --format-version=1 | jq .packages[0].name | |
"ferris" |
NewerOlder