This file contains hidden or 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
| private static void fetchCertificate(String resumeToken, List<String> possibleKids) throws CertificateException, IOException { | |
| System.out.println("Fetching new certificate"); | |
| // rest call | |
| Response<String> resp = apiCertificate.getCertUpdate(resumeToken).execute(); | |
| if (resp.isSuccessful()) { | |
| var headers = resp.headers(); | |
| var responseKid = headers.get(HEADER_KID); |
This file contains hidden or 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 gae.piaz.grpc.server; | |
| import gae.piaz.grpc.lib.HelloReply; | |
| import gae.piaz.grpc.lib.HelloRequest; | |
| import gae.piaz.grpc.lib.SimpleGrpc; | |
| import io.grpc.stub.StreamObserver; | |
| import net.devh.boot.grpc.server.service.GrpcService; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; |
This file contains hidden or 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
| syntax = "proto3"; | |
| option java_multiple_files = true; | |
| option java_package = "gae.piaz.grpc.lib"; | |
| option java_outer_classname = "FirstProto"; | |
| service Simple { | |
| rpc SayHello (HelloRequest) returns (HelloReply) { | |
| } | |
| } |
This file contains hidden or 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 gae.piaz.grpc.client; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.RequestParam; | |
| import org.springframework.web.bind.annotation.RestController; | |
| @RestController | |
| public class GrpcClientController { |
This file contains hidden or 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 gae.piaz.grpc.lib.HelloReply; | |
| import gae.piaz.grpc.lib.HelloRequest; | |
| import gae.piaz.grpc.lib.SimpleGrpc; | |
| import org.springframework.stereotype.Service; | |
| import io.grpc.StatusRuntimeException; | |
| import net.devh.boot.grpc.client.inject.GrpcClient; | |
| @Service | |
| public class GrpcClientService { |
This file contains hidden or 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.jboss.logging.Logger; | |
| import org.jboss.msc.service.ServiceContainer; | |
| import org.jboss.msc.service.ServiceController; | |
| import org.jboss.msc.service.ServiceName; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Service; | |
| import org.wildfly.security.credential.PasswordCredential; | |
| import org.wildfly.security.credential.store.CredentialStore; | |
| import org.wildfly.security.credential.store.CredentialStoreException; | |
| import org.wildfly.security.password.Password; |
This file contains hidden or 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
| smtp: | |
| host: "host.test.it" | |
| port: "25" | |
| auth: "true" | |
| username: "username" | |
| password: ${SMTP_PASSWORD} | |
| email-from: "[email protected]" | |
| email-from-name: "Name" |
This file contains hidden or 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
| @Service | |
| public class MailService implements MailServiceI { | |
| @Value("${smtp.host}") | |
| private String host; | |
| @Value("${smtp.auth}") | |
| private String auth; | |
| @Value("${smtp.port}") |
This file contains hidden or 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: | |
| labels: | |
| app: test-ms | |
| release: 2.0.2 | |
| name: test-ms | |
| namespace: test | |
| spec: | |
| replicas: 1 |
This file contains hidden or 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.util.*; | |
| import org.apache.commons.lang3.SystemUtils; | |
| public List<String> searchSo() { | |
| List<String> found = new ArrayList<>(); | |
| // apache lang is awesome. | |
| if (SystemUtils.IS_OS_WINDOWS) { |