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
$curl -s "<https://get.sdkman.io>" | bash | |
$source "$HOME/.sdkman/bin/sdkman-init.sh" |
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 com.giljae.springnativeexample; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.test.web.reactive.server.WebTestClient; | |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | |
@AutoConfigureWebTestClient |
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 com.giljae.springnativeexample; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.web.reactive.function.server.RouterFunction; | |
import org.springframework.web.reactive.function.server.ServerResponse; | |
import reactor.core.publisher.Mono; | |
import static org.springframework.web.reactive.function.server.RouterFunctions.route; | |
import static org.springframework.web.reactive.function.server.ServerResponse.ok; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> | |
<version>2.4.4</version> | |
<relativePath /> <!-- lookup parent from repository --> |
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
docker container run ch02-hello-world |
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
@Bean | |
public io.opentracing.Tracer jaegerTracer() { | |
Builder builder = new Builder("spring-boot", | |
new RemoteReporter(new HttpSender("http://jaeger-collector.istio-system:14268/api/traces"), 10, | |
65000, new Metrics(new StatsFactoryImpl(new NullStatsReporter()))), | |
new ConstSampler(true)) | |
.registerInjector(Builtin.HTTP_HEADERS, new B3TextMapCodec()) | |
.registerExtractor(Builtin.HTTP_HEADERS, new B3TextMapCodec()); | |
return builder.build(); | |
} |
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
@RestController | |
public class HelloController { | |
@Autowired | |
private RestTemplate restTemplate; | |
@RequestMapping(value = "/hello") | |
public String hello() { | |
return "Hello from Spring Boot!"; | |
} |
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
sum=0 | |
for i in range(3,1000): | |
if i%3==0 or i%5==0: | |
sum+=i | |
print(sum) |
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 subprocess | |
def call(value): | |
cmd = ['java','-jar','{jar 파일 경로}','{arg}',value] | |
fd_open = subprocess.Popen(cmd,stdout=subprocess.PIPE,shell=False).stdout | |
result = fd_open.read().strip() | |
fd_open.close() | |
return result | |
def main(): |
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 subprocess | |
def call(value): | |
cmd = ['java','-jar','{jar 파일 경로}','{arg}',value] | |
return subprocess.check_output(cmd,shell=False) | |
def main(): | |
result = call("test") | |
print "result |
NewerOlder