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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-skaffold-gke-deployment | |
namespace: default | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hello-skaffold-gke |
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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-skaffold-gke-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hello-skaffold-gke | |
template: |
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: skaffold/v2beta16 | |
kind: Config | |
metadata: | |
name: hello-skaffold-gke | |
build: | |
artifacts: | |
- image: hello-skaffold-gke | |
jib: {} | |
deploy: | |
kubectl: |
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{ | |
id 'java' | |
id "io.github.bijukunjummen.cloudfunction" | |
} | |
dependencies { | |
... | |
} | |
cloudFunction { |
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
configurations { | |
invoker | |
} | |
dependencies { | |
... | |
invoker("com.google.cloud.functions.invoker:java-function-invoker:1.1.0") | |
... | |
} |
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 com.google.cloud.functions.HttpFunction; | |
import com.google.cloud.functions.HttpRequest; | |
import com.google.cloud.functions.HttpResponse; | |
public class HelloHttp implements HttpFunction { | |
@Override | |
public void service(HttpRequest request, HttpResponse response) throws IOException { | |
final BufferedWriter writer = response.getWriter(); | |
response.setContentType("application/html"); |
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 org.bk.logback.custom; | |
import ch.qos.logback.classic.Level; | |
import ch.qos.logback.classic.spi.ILoggingEvent; | |
import ch.qos.logback.contrib.json.classic.JsonLayout; | |
import com.google.cloud.logging.Severity; | |
import java.util.Map; | |
public class GcpJsonLayout extends JsonLayout { |
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
public Mono<Void> publish(Message message) { | |
ByteString data = ByteString.copyFromUtf8(JsonUtils.writeValueAsString(message, objectMapper)); | |
PubsubMessage pubSubMessage = PubsubMessage.newBuilder().setData(data).build(); | |
return Mono.fromFuture(pubSubTemplate.publish(pubSubProperties.topic(), pubSubMessage).completable()).then(); | |
} |
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
public Mono<Void> publish(Message message) { | |
ByteString data = ByteString.copyFromUtf8(JsonUtils.writeValueAsString(message, objectMapper)); | |
PubsubMessage pubSubMessage = PubsubMessage.newBuilder().setData(data).build(); | |
ApiFuture<String> messageIdFuture = publisher.publish(pubSubMessage); | |
Mono<String> messageIdMono = ApiFutureUtil.toMono(messageIdFuture); | |
return messageIdMono.then(); | |
} |
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
public record Message(String id, String payload) { | |
} |