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
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.net.Socket; | |
public final class BasicTcpClient implements AutoCloseable { | |
private static final int READ_BUF_LEN = 4096; | |
private final Socket socket; |
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
import org.junit.Assert; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.core.MethodParameter; | |
import org.springframework.test.annotation.DirtiesContext; | |
import org.springframework.test.context.junit4.SpringRunner; |
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
apiVersion: v1 | |
clusters: | |
- cluster: | |
certificate-authority: /Users/umitunal/.minikube/ca.crt | |
server: https://192.168.99.100:8443 | |
name: minikube | |
contexts: | |
- context: | |
cluster: minikube | |
user: minikube |
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
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: kubernetes-dashboard | |
labels: | |
k8s-app: kubernetes-dashboard | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: cluster-admin |
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
import org.elasticsearch.action.index.IndexResponse; | |
import org.elasticsearch.client.Client; | |
import org.junit.ClassRule; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.test.context.junit4.SpringRunner; | |
import org.testcontainers.containers.FixedHostPortGenericContainer; | |
import org.testcontainers.containers.GenericContainer; |
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.2' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4 | |
container_name: elasticsearch | |
environment: | |
- cluster.name=docker-cluster | |
- bootstrap.memory_lock=true | |
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
ulimits: |
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
<plugin> | |
<groupId>org.liquibase</groupId> | |
<artifactId>liquibase-maven-plugin</artifactId> | |
<version>3.6.1</version> | |
<configuration> | |
<driver>org.postgresql.Driver</driver> | |
<url>jdbc:postgresql://localhost:5432/api</url> | |
<username>root</username> | |
<password>123qwe</password> |
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
import org.springframework.stereotype.Component; | |
import reactor.core.publisher.Mono; | |
import reactor.core.scheduler.Schedulers; | |
import reactor.retry.Retry; | |
import reactor.retry.RetryExhaustedException; | |
import java.time.Duration; | |
import java.util.function.Supplier; | |
@Component |
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
import org.reactivestreams.Publisher; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
import org.springframework.data.repository.reactive.ReactiveCrudRepository; | |
import reactor.core.publisher.Flux; | |
import reactor.core.publisher.Mono; | |
import reactor.core.scheduler.Scheduler; | |
import reactor.core.scheduler.Schedulers; |
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
List<String> images = IntStream.range(0, 100).mapToObj(each -> "https://picsum.photos/1024/1024/?random").collect(Collectors.toList()); | |
Scheduler subWorker = Schedulers.fromExecutor(Executors.newFixedThreadPool(20)); | |
Scheduler pubWorker = Schedulers.newParallel("aaaa", 5); | |
RestTemplate restTemplate = new RestTemplate(); | |
Function<String, Publisher<byte[]>> stringPublisherFunction = each -> Mono.defer(() -> { | |
System.out.println("flux:Mono executor: " + Thread.currentThread().getName() + "- " + Thread.currentThread().getId()); |