Transport / gRPC
gRPC transport will enable the Inventory Service to call your plugin using gRPC protocol.
You are free to use any programming language to implement plugin API as long as it is supported by the currently used gRPC version. Please note that we would not be able to consult you with any particular issues potentially arising because of language choices as there are various gotchas among different GRPC language implementations. We on our end use Java 8 and would only be in position to advise if you had issues with this language in particular. We can also provide you with an archetype project (written in Java 8) which you could use to kickstart the development.
We are currently using version 1.11 of gRPC protocol.
We strongly recommend familiarising yourselves with gRPC framework before starting any development work. Failure of doing so might result increased time to delivery as well as odd bugs.
gRPC API Bindings (stubs)
You can generate the bindings from our .proto files. The following two should be sufficient for generating the API bindings:
If your server implementation is in Java, we recommend using the same bindings which are generated by us and used by our Sample plugin to avoid any potential discrepancies (refer to dependencies section of the Gradle build file and look for io.bokun.inventory group). Libraries are hosted on AWS S3 and are made publicly available for download.
We offer the following security measures to protect the traffic against snooping and unauthorized usage:
- Shared secret. It is possible to use static shared secret between both Inventory service and the plugin. Every request will carry the shared secret in its payload.
- TLS/SSL. We offer the ability for both parties to talk via SSL. It is possible to use self-generated certificates as well, you just need to provide us with the certificate in .crt format. Generally, we will require the certificate if out of the box Java 8 SSL framework does not recognize your Certificate Authority.
- Whitelist of IP addresses. We can provide you with a list of IP addresses which are used for our test & production systems. All outgoing requests will be originated by those addresses.
gRPC timeouts (deadlines)
Inventory Service gRPC client has 10 seconds deadline on
Responses for other calls will be ignored (consumed by Inventory Service but ignored in the upper chain) if there is no response within 60 seconds. Please note that lengthy response times have direct impact on the UX.
NOTE: Even if a response from the plugin is accepted by the Inventory Service, it might be no longer relevant nor considered by the upper chain of consumers. For example, if a booking reservation request originally came from Expedia OTA, their API will timeout within 2400 ms resulting a discrepancy between systems. Please make sure you double check if your plugin is capable of delivering responses within acceptable time if you plan integration with particular OTA(s). Refer to SLA requirements / timeouts for OTAs for more details.