GRPC? ???? Java ???? ??? ??? ??????. 2. .Proto ??? ?? ??? ??? ?????. 3. Maven?? GRPC ???? ???? ??? ?????. 4. GRPC ?? ?? ??; 5. ?????? ?? ???; 6. TLS, ?? ??, ??? ?? ? ?? ???? ?? ???? ?????????. ??? ?? ????? ??-?? ???? ??? ?? ???? ???? ??????.
??? Java MicroServices ????? ???? GRPC? ???? ????? ?? ??. ?? ?? ? ?? ???? ????? ? ??? ?? ??? ? ??????? ??? ????? ??? ? ??????? ?????. ???? ?? ???? ??? ??? ????.

GRPC? Java ???? ???? ??? ??
??? ?? ?? ?? MicroServices ???? GRPC? ? ? ??? ? ? ????.
- ??? : HTTP/2 ? ?? ??? (???? ??)? ????? HTTP/1.1?? JSON?? ??? ?????.
- ??? ?? : ??? ????? ? ??? ???
.proto
??? ???? API? ????? ??? ?? ?????. - ?? ?? ?? : ???? ? ? ???? ??? Java (? ?? ??)? ?? ????? ? ?? ??? ?????.
- ???? ?? : GRPC? ?? ????, ????? ???? ? Bididirectional Streaming? ?????. ??? ?? ??? ?? ??? ?????.
???? ?? ???? (? : ?? ??? ?? ?? ???) GRPC? ?? ??? ??? ???? ???? ? ????.

1 ?? : ???? ??? ???? ??????
.proto
??? ???? ??????. ??? ??? ??? ??? ?????? ?????.
? : inventory.proto

?? = "proto3"; ??? com.example.inventory; ??? ?? ??? { rpc getStock (StockRequest) ?? (StockResponse); } ??? StockRequest { ??? product_id = 1; } ??? stockresponse { int32 availing_count = 1; }
??? ??? ??? ???? ??? ???? ?????. ?? ???? ???? ?? .proto
??? ?? ?? ?? ???? ??????.
2 ?? : Java ?????? GRPC? ??????
Maven ?? Gradle? ??????. ??? ?? Maven Setup ( pom.xml
)???.
<???> <???> <groupid> io.grpc </groupid> <artifactid> grpc-netty-shaded </artifactid> <??> 1.58.0 </??> </???> <???> <groupid> io.grpc </groupid> <artifactid> grpc-protobuf </artifactid> <??> 1.58.0 </??> </???> <???> <groupid> io.grpc </groupid> <artifactid> grpc-stub </artifactid> <??> 1.58.0 </??> </???> </???> <??> <???> <???> <groupid> kr.motd.maven </groupid> <artifactid> os-maven-plugin </artifactid> <??> 1.7.1 </??> </??> </Extensions> <????> <????> <groupid> org.xolstice.maven.plugins </groupid> <artifactid> protobuf-maven-plugin </artifactid> <??> 0.6.1 </??> <??> <protosourceroot> $ {project.basedir}/src/main/proto </protoSourceroot> <outputDirectory> $ {project.build.directory}/Generated-Sources </outputDirectory> <ClearOutPutDirectory> false </staroutputDirectory> </??> <??> <??> <??> <Goal> Compile </Goal> <Goal> Compile-Custom </Goal> </??> </??> </??> </????> </????> </??>
??? ?? ? ? ?? :
MVN ???
????? ?????? ???, ?? ? ??? ??? ???? .proto
???? Java ???? ?????.
3 ?? : ?? ??
?? ? InventoryServiceGrpc.InventoryServiceImplBase
???? ???? ????.
IO.GRPC.SERVER ?? ??; IO.GRPC.SERVERBUILDER ?? ??; import java.io.ioexception; ?? ??? ???? ?? { ?? ?? ??; public void start ()? ioexception { Server = ServerBuilder.forport (8080) .addservice (new inventoryserviceimpl ()) .??() .??(); System.out.println ( "?? 8080?? ??? ??"); runtime.getRuntime (). addShutdownHook (? ??? (() -> { System.out.println ( "GRPC ?? ??"); InventoryServer.this.stop (); }); blockuntIlShutdown (); } ?? void blockuntilShutdown ()? ?? ? ?? ?? { if (server! = null) { server.awaittermination (); } } ?? void stop () { if (server! = null) { server.shutdown (); } } public static void main (String [] args)? ioexception? ???, InterruptedException { ? ?? ?? (). start (); } ?? ??? ???? viceimpl? inventoryservicegrpc.inventoryserviceimplbase {{ @?? public void getStock (StockRequest ??, StreamObserver <StockResponse> ResponseObserver) { // ?? ????? int stock = "p123".equals (request.getProductId ())? 42 : 0; stockresponse response = stockresponse.newbuilder () .SetAvailAbleCount (??) .??(); ResponseObserver.onnext (??); ResponseObserver.oncompleted (); } } }
?? ?? - ??? ???? GRPC ??? ????.
4 ?? : ?? ???? ??? (?????)?? ???? ?????.
?? ?? ??? (? : ?? ???)?? GRPC ?????? ??????.
?? ??? ???? ??? { ?? ?? ???? ?? GRPC.InventoryServiceBlockingStub BlockingStub; ?? ???? ??? (??? ???, int ??) { ManagedChannel Channel = ManagedChannelBuilder.foraddress (???, ??) .usePlainText () // tls??? ??? ???? ???? .??(); BlockingStub = InventoryServiceGrpc.NewBlockingStub (??); } public int getstock (String productId) { StockRequest Request = StockRequest.NewBuilder (). SetProductId (productId) .build (); StockRepronse ?? = BlockingStub.getStock (??); return response.getavailableCount (); } }
??? ?? ??????.
???? ????? ????? = ??? ?? ????? ( "LocalHost", 8080); int stock = client.getstock ( "p123"); System.out.println ( "?? :"??);
?? ????? ?
- ???? TLS ?? : ?? ??? ? ???? ???????. GRPC? ???? SSL/TLS? ?????.
- GRPC ?? ??? ??? ?????? . ?? ?? ???
Status
?StatusException
??????. - ??? ??? ?? : Consul, Eureka ?? Kubernetes DNS? ?? ??? GRPC? ???????.
- ?? ??? ?? : ??, ??? (? : ???? ??) ? ?? ?? (? : OpenTelemetry)? ????? ??????.
- ??? ?? ?? ????? ..
.proto
??? ??? ????, ???? ??? ????, ?? ??? ?????.
???
Java MicroServices ??? GRPC? ??, ?? ?? ? ??? ?????? ?????. ?? ?? : ? ???? ???? ???? ?? ???? ??????. ???? ????, ?? ? ????? ??????.
?? ??? ??? ???? (? : ???? ?????? ??? ??) ??? ? ?? ??????? ???? ?? ? ????.
????? .proto
????, ??? ????, ??? ????, ??????? ??????.
? ??? Java ???? ??? ?????? GRPC? ?????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Maven? Java ???? ?? ? ????? ?? ?????. ?? POM.XML? ???? ???? ??, ??? ??, ?? ??? ??? ??? ? ???? ??? ?????? ??? ????. 1. pom.xml? ???? groupId, artifactid, ?? ? ???? ??????. 2. MVNClean, ???, ???, ???, ?? ? ??? ?? ??? ?? ??; 3. ??? ?? ? ??? ???? ?? ??? ?? ? ??? ?????. 4. ?? ?? ???? ??? ?? ??? ?? ????? ???? ?? POM? ?? ???? ?????. 5.

setupamaven/gradleProjectwithJax-rsddependencies likejersey; 2. createarestresourceUsingAnnotationsSuchas@pathand@get;

??, ??, ?? ??, ?? ???? ? ???? ??? ?? ??? ?? ?? ??? ?????. 2. ???, ?? ???, ?? ?? ? ? ?? ?? ? ?? ???? ???? SHA-256 ?? ?? ? ?? ?? ??? ?????. 3. ?? ??? ???? ?? ??? ????, ??? ??? ?????, ? ??? ???? ??? ???? ???? ?? ?? ?? ???? ??????. 4. ?? ??? ?? ??? ???? ???? ??? ??? ??? ???? ?? ?? ??? ??????. 5. ??? ?? ???? ???? ??, P2P ????, ??? ??, RESTAPI ? ??? ???; 6. ?? ?? ????? HyperledgerFabric, Web3J ?? Corda? ?? Java ?? ?? ?????? ??? ? ????.

@Property Decorator? ??? ??, ?? ? ?? ??? ???? ?? ???? ???? ???? ? ?????. 1. ?? ?? : @property? ?? ?? ?? ??? ????, ?? ?? ??? ???? ???? ?? ????? ??; 2. ?? ?? : @name.setter ? @name.deleter? ???? ?? ?? ?? ? ?? ??? ?????. 3. ?? ?? ???? : BankAccount? ?? ???? ??? ??? ???? ??? ??? ??? ??????. 4. ?? ?? ?? : ?? ??? ????? ?? ??? ??? ??? ???? ?? ??? ??? ?? ?? ? ?? ??? ?????.

?? JavaScript? ???? ??? ??? ?? ??? ??? ??? ?? ??? ?? ??? ??? ???????. 1. HTML ???? ?? ???? ????? ??? ???? ????. 2. CSS ?? : ??? ?? ?? ??? ???? ?? ??, .dark-mode ???? ??? ?? ??? ???? var ()? ?? ??? ??? ?????. 3. JavaScript? ??? ???? ?? ???? ?? ??? ???? ?? LocalStorage? ????. 4. ??? ?? ? ? HTML ???? Dark-Mode ???? ???? ?? ??? LocalStorage? ?????. 5. ?? ?? ?? ??? 0.3 ? ?? ?????? ???? ???? ??????.

Java? ???? ?? ?? ????? MessageDigest ???? ?? ??? ? ????. 1. MD5 ?? SHA-256? ?? ??? ????? ????? ?????. 2. ??? ? ???? ????? .update () ???? ??????. 3. ?? ??? ??? ???? .digest () ???? ??????. 4. ??? ??? ??? ?? 16 ?? ???? ?????. ? ??? ?? ??? ?? ??? ?? .update ()? ?? ? ??????. ??? ???? ?? MD5 ?? SHA-1 ?? SHA-256? ???? ?? ????.

?, ?? CSS ?? ?? ??? JavaScript??? ??? HTML ? CSS? ?? ??? ? ????. 1. ?? UL? Li? ???? ?? ??? ??????. 2. ?? ?? ???? ???? ?????? ???? ??? ???? ???; 3. ?? ?? : ?? Li? ???, ?? ??? ??? ???? ?????. ??; 4. ?? ??? ???? ??? : ??, ????????? : ???? ??; 5. ?? ?? ???? ??? ?? ????, ??? ????, ??? ? ?????? ???? ??? ????? ??? ???? ??? ? ????. ?? ???? ???? JavaScript ??? ???? ???? ??? ?????.

DateTime.strpTime ()? ???? ?? ???? DateTime ??? ??????. 1. ?? ?? : "%y-%m-%d"? ?? DateTime ???? "2023-10-05"; 2. ?? ??? "%m/%d/%y", "%d/%m/%y", ?? ??? ?? ???? ?? "%b%d,%y%i :%m%p"? ?? ?? ??? ?????. 3. dateUtil.parser.parse ()? ???? ? ??? ??? ???? ?????. 4. ?? .D
