SlideShare a Scribd company logo
1 of 10
Download to read offline
appengine
java night #2
ProtocolBuffer on HTTP
   shin1ogawa@
ApiProxy#getDelegate()

 Application              Stub


 LowLevelAPI

                          PB
            ApiProxy
  PB     #getDelegate()
Delegate#makeSyncCall()
Service   ,Method   ,Request(byte[])

    ApiProxy
 #getDelegate()
 #makeSyncCall()


  PB(byte[])               Stub/
Server                  …


•               ApiProxy.setDelegate(
    Delegate)
    ProtocolBuffer
•
    ProtocolBuffer
•               OreOreDelegate
    #makeSyncCall()              Stub


•
    ApiProxy.getDelegate().makeSyncCall()


•             OreOreDelegate
     Low-Level API
    • Low-Level API        Application
ProtocolBuffer on HTTP


 Application


 LowLevelAPI
                           PB
 PB              OreOreServlet
OreOreDelegate
                 PB
MakeSyncCallServlet
           makeSyncCall()
String serviceName =
  req.getHeader(SERVICE_NAME);
String methodName = req.getHeader(METHOD_NAME);
byte[] requestBytes =
  IOUtils.toByteArray(req.getInputStream());
byte[] responseBytes =
  ApiProxy.getDelegate().makeSyncCall(
    ApiProxy.getCurrentEnvironment(),
    serviceName, methodName, requestBytes);
resp.getOutputStream().write(responseBytes);
MakeSyncCallDelegate
MakeSyncCall
public byte[] makeSyncCall(
  Environment environment, String serviceName,
  String methodName, byte[] request)
  throws ApiProxyException {
	 	 return protocolBufferOnHttp(
       environment,
       serviceName, methodName, request);
}
byte[] protocolBufferOnHttp(.....) {
  // makeSyncCall Post    byte[]
}
•       Datastore
    "         Datastore
•       Datastore
    "         Datastore
•       Memcache
    "         Memcache
shin1ogawa@

More Related Content

What's hot

jChaart - Web Dashboard Framework
jChaart - Web Dashboard FrameworkjChaart - Web Dashboard Framework
jChaart - Web Dashboard Framework
oazabir
 

What's hot (19)

Extending Retrofit for fun and profit
Extending Retrofit for fun and profitExtending Retrofit for fun and profit
Extending Retrofit for fun and profit
 
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupCachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
 
Grails plugin
Grails pluginGrails plugin
Grails plugin
 
Consul presentation
Consul presentationConsul presentation
Consul presentation
 
Altitude NY 2018: Don't let the weeds overwhelm the garden
Altitude NY 2018: Don't let the weeds overwhelm the gardenAltitude NY 2018: Don't let the weeds overwhelm the garden
Altitude NY 2018: Don't let the weeds overwhelm the garden
 
DrupalCafe4 Kiev Services
DrupalCafe4 Kiev ServicesDrupalCafe4 Kiev Services
DrupalCafe4 Kiev Services
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Scala45 spray test
Scala45 spray testScala45 spray test
Scala45 spray test
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and FluxTPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
 
Embuk internals
Embuk internalsEmbuk internals
Embuk internals
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
 
Boto3
Boto3Boto3
Boto3
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
 
jChaart - Web Dashboard Framework
jChaart - Web Dashboard FrameworkjChaart - Web Dashboard Framework
jChaart - Web Dashboard Framework
 
A real-world Relay application in production - Stefano Masini - Codemotion Am...
A real-world Relay application in production - Stefano Masini - Codemotion Am...A real-world Relay application in production - Stefano Masini - Codemotion Am...
A real-world Relay application in production - Stefano Masini - Codemotion Am...
 
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQRealtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable Functions
 
Azure sql insert perf
Azure sql insert perfAzure sql insert perf
Azure sql insert perf
 

Viewers also liked

Appengine Java Night #2 LT
Appengine Java Night #2 LTAppengine Java Night #2 LT
Appengine Java Night #2 LT
Shinichi Ogawa
 
Appengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 btAppengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 bt
Shinichi Ogawa
 
Appengine ja-night-sapporo#1
Appengine ja-night-sapporo#1Appengine ja-night-sapporo#1
Appengine ja-night-sapporo#1
Shinichi Ogawa
 
Java Cloud Meeting Fukuoka 2010
Java Cloud Meeting Fukuoka 2010Java Cloud Meeting Fukuoka 2010
Java Cloud Meeting Fukuoka 2010
Shinichi Ogawa
 
Appengine Java Night #2b
Appengine Java Night #2bAppengine Java Night #2b
Appengine Java Night #2b
Shinichi Ogawa
 
Devlove hangar flight-wintersortie-shin1ogawa
Devlove hangar flight-wintersortie-shin1ogawaDevlove hangar flight-wintersortie-shin1ogawa
Devlove hangar flight-wintersortie-shin1ogawa
Shinichi Ogawa
 
Java cloud-meeting-2010tokyo-shin1ogawa
Java cloud-meeting-2010tokyo-shin1ogawaJava cloud-meeting-2010tokyo-shin1ogawa
Java cloud-meeting-2010tokyo-shin1ogawa
Shinichi Ogawa
 
Appengine Java Night #2a
Appengine Java Night #2aAppengine Java Night #2a
Appengine Java Night #2a
Shinichi Ogawa
 
Appengine ja-night#13bt
Appengine ja-night#13btAppengine ja-night#13bt
Appengine ja-night#13bt
Shinichi Ogawa
 
appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
Shinichi Ogawa
 
Using Facebook to Help Your Business
Using Facebook to Help Your BusinessUsing Facebook to Help Your Business
Using Facebook to Help Your Business
Daniel Laird
 

Viewers also liked (17)

Appengine Java Night #2 LT
Appengine Java Night #2 LTAppengine Java Night #2 LT
Appengine Java Night #2 LT
 
Appengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 btAppengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 bt
 
Appengine ja-night-sapporo#1
Appengine ja-night-sapporo#1Appengine ja-night-sapporo#1
Appengine ja-night-sapporo#1
 
Java Cloud Meeting Fukuoka 2010
Java Cloud Meeting Fukuoka 2010Java Cloud Meeting Fukuoka 2010
Java Cloud Meeting Fukuoka 2010
 
Appengine Java Night #2b
Appengine Java Night #2bAppengine Java Night #2b
Appengine Java Night #2b
 
Devlove hangar flight-wintersortie-shin1ogawa
Devlove hangar flight-wintersortie-shin1ogawaDevlove hangar flight-wintersortie-shin1ogawa
Devlove hangar flight-wintersortie-shin1ogawa
 
Java cloud-meeting-2010tokyo-shin1ogawa
Java cloud-meeting-2010tokyo-shin1ogawaJava cloud-meeting-2010tokyo-shin1ogawa
Java cloud-meeting-2010tokyo-shin1ogawa
 
2011 12-07 ragtech2011
2011 12-07 ragtech20112011 12-07 ragtech2011
2011 12-07 ragtech2011
 
Appengine Java Night #2a
Appengine Java Night #2aAppengine Java Night #2a
Appengine Java Night #2a
 
Appengine ja-night#13bt
Appengine ja-night#13btAppengine ja-night#13bt
Appengine ja-night#13bt
 
2011 01 16 NIS Training (Chcuk Generic)
2011 01 16 NIS Training (Chcuk Generic)2011 01 16 NIS Training (Chcuk Generic)
2011 01 16 NIS Training (Chcuk Generic)
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料
 
GCP Refresher Training (Chcuk) V2
GCP Refresher Training (Chcuk) V2GCP Refresher Training (Chcuk) V2
GCP Refresher Training (Chcuk) V2
 
Gaej For Beginners
Gaej For BeginnersGaej For Beginners
Gaej For Beginners
 
appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
 
Using Facebook to Help Your Business
Using Facebook to Help Your BusinessUsing Facebook to Help Your Business
Using Facebook to Help Your Business
 
Liferay
LiferayLiferay
Liferay
 

Similar to Appengine Java Night #2 Lt

Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
Hiroshi Nakamura
 

Similar to Appengine Java Night #2 Lt (20)

Introduction to Retrofit
Introduction to RetrofitIntroduction to Retrofit
Introduction to Retrofit
 
Apigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM iApigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM i
 
Java Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to Miss Java Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to Miss
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API Documentation
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
 
Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
 
API Days Australia - Automatic Testing of (RESTful) API Documentation
API Days Australia  - Automatic Testing of (RESTful) API DocumentationAPI Days Australia  - Automatic Testing of (RESTful) API Documentation
API Days Australia - Automatic Testing of (RESTful) API Documentation
 
Rethinking Syncing at AltConf 2019
Rethinking Syncing at AltConf 2019Rethinking Syncing at AltConf 2019
Rethinking Syncing at AltConf 2019
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API Documentation
 
spray: REST on Akka
spray: REST on Akkaspray: REST on Akka
spray: REST on Akka
 
Gohan
GohanGohan
Gohan
 
Julio Capote, Twitter
Julio Capote, TwitterJulio Capote, Twitter
Julio Capote, Twitter
 
Bpstudy20101221
Bpstudy20101221Bpstudy20101221
Bpstudy20101221
 
Reliable Python REST API (by Volodymyr Hotsyk) - Web Back-End Tech Hangout - ...
Reliable Python REST API (by Volodymyr Hotsyk) - Web Back-End Tech Hangout - ...Reliable Python REST API (by Volodymyr Hotsyk) - Web Back-End Tech Hangout - ...
Reliable Python REST API (by Volodymyr Hotsyk) - Web Back-End Tech Hangout - ...
 
マイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCマイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPC
 
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIsHTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
 
A Brief History of OWIN
A Brief History of OWINA Brief History of OWIN
A Brief History of OWIN
 
Building Better Web APIs with Rails
Building Better Web APIs with RailsBuilding Better Web APIs with Rails
Building Better Web APIs with Rails
 
Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6
 
So you think you know REST - DPC11
So you think you know REST - DPC11So you think you know REST - DPC11
So you think you know REST - DPC11
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Appengine Java Night #2 Lt

  • 2. ApiProxy#getDelegate() Application Stub LowLevelAPI PB ApiProxy PB #getDelegate()
  • 3. Delegate#makeSyncCall() Service ,Method ,Request(byte[]) ApiProxy #getDelegate() #makeSyncCall() PB(byte[]) Stub/
  • 4. Server … • ApiProxy.setDelegate( Delegate) ProtocolBuffer • ProtocolBuffer
  • 5. OreOreDelegate #makeSyncCall() Stub • ApiProxy.getDelegate().makeSyncCall() • OreOreDelegate Low-Level API • Low-Level API Application
  • 6. ProtocolBuffer on HTTP Application LowLevelAPI PB PB OreOreServlet OreOreDelegate PB
  • 7. MakeSyncCallServlet makeSyncCall() String serviceName = req.getHeader(SERVICE_NAME); String methodName = req.getHeader(METHOD_NAME); byte[] requestBytes = IOUtils.toByteArray(req.getInputStream()); byte[] responseBytes = ApiProxy.getDelegate().makeSyncCall( ApiProxy.getCurrentEnvironment(), serviceName, methodName, requestBytes); resp.getOutputStream().write(responseBytes);
  • 8. MakeSyncCallDelegate MakeSyncCall public byte[] makeSyncCall( Environment environment, String serviceName, String methodName, byte[] request) throws ApiProxyException { return protocolBufferOnHttp( environment, serviceName, methodName, request); } byte[] protocolBufferOnHttp(.....) { // makeSyncCall Post byte[] }
  • 9. Datastore " Datastore • Datastore " Datastore • Memcache " Memcache