LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub

Client SDK

Project teams often ask if we can add a codegen feature to generate client SDK to help consumers invoke the API based on the specification. The SwaggerHub codegen does it, and many users are getting used to the client SDK approach provided by the API.

In my opinion, I don’t think it is right to use client SDK to invoke APIs unless the API is public and a lot of clients are trying to integrate with it. For business APIs consumed internally, issuing an SDK to consumers will force all consumers to upgrade once the provider is upgraded. Instead of building independent microservices, we tightly coupled the provider and consumer to build a distributed monolithic application. This pattern is even worse than the monolithic application running in a JavaEE container.

Another reason we don’t want to generate client SDK is due to the maintenance effort. We cannot assume that all clients will be implemented in the same language as the service. So we have to generate client SDK with different popular languages. For each language, there might be different HTTP clients, and we need to consider them.

If we ever want to help consumers, we would rather create a common library for each language to manage the connection and construct the HTTP request. In this way, we can eliminate the repeatable work from the developers and still give developers the flexibility to invoke APIs based on their business requirements.

The above discussion is based on the implementation of SwaggerHub client SDK. However, other aspects need to be considered for API consumption. From the client’s point of view, some cross-cutting concerns need to be addressed before calling the downstream APIs. For example, how to get a JWT token from the OAuth 2.0 provider and cache it and renew the token without impacting the current request. In a cloud with microservices, how to perform the service discovery before invoking the downstream API etc.

We have provided http-sidecar to help API to API invocation in a Kubernetes cluster for outgoing traffic to answer these questions.

For standalone consumers, we have provided light-router that can be used along with the consumer to bring the legacy client into the light-4j ecosystem. For more information, please refer to legacy application document.

  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“Client SDK” was last updated: November 9, 2021: fixes #312 add a document for client SDK generation (56fdc7d)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute