-
Notifications
You must be signed in to change notification settings - Fork 59
Licensing Service
Wuyi Chen edited this page Jun 29, 2019
·
13 revisions
Manage (query, add, update, delete) license records.
- Spring Data JPA
- Netflix Feign
- Netflix Eureka
- Netflix Hystrix
- URL: http://localhost:8080/v1/organizations/{organizationId}/licenses/
- Method: GET
-
Parameters:
- organizationId: The organization ID for looking up.
- Headers
- Body
-
Notes:
- This call will get license records only, so it will not trigger another call from licensing service to organization service.
- This call will simulate the long-running randomly to trigger the time out exception from circuit breaker (Sometime you will see 500 error as the response).
- URL: http://localhost:8080/v1/organizations/{organizationId}/licenses/{licenseId}
- Method: GET
-
Parameters:
- organizationId: The organization ID for looking up.
- licenseId: The license ID for looking up.
- Headers
- Body
-
Notes:
- This call will get the license record only, so it will not trigger another call from licensing service to organization service.
LS3: Get a license record associated with the organization record by organization ID and license ID.
- URL: http://localhost:8080/v1/organizations/{organizationId}/licenses/{licenseId}/{clientType}
- Method: GET
-
Parameters:
- organizationId: The organization ID for looking up.
- licenseId: The license ID for looking up.
- clientType: The way for calling the organization service for getting the organization record. There are 3 possible values:
- rest: Use Ribbon-backed Spring RestTemplate to call.
- feign: Feign client to call.
- discovery: Use Spring DiscoveryClient with the Spring RestTemplate to call.
- Headers
KEY | VALUE |
---|---|
Authorization | Bearer {access_token} |
- Body
-
Notes:
- This call will get the license record and also get an organization record, so it will trigger another call from the licensing service to the organization service.
- Because of the organization service is protected and only be accessible with the valid access token, you need to add a valid access token to the header of this call.
- URL: http://localhost:8080/v1/organizations/{organizationId}/licenses/{licenseId}
- Method: PUT
-
Parameters:
- organizationId: The organization ID for looking up.
- licenseId: The license ID for looking up.
- Headers:
KEY | VALUE |
---|---|
Content-Type | application/json |
- Body (example):
{
"licenseId": "f3831f8c-c338-4ebe-a82a-e2fc1d1ff78a",
"organizationId": "e254f8c-c442-4ebe-a82a-e2fc1d1ff78a",
"productName": "CustomerPro",
"licenseType": "user",
"licenseMax": 100,
"licenseAllocated": 5,
"comment": "The default configuration"
}
- Notes
- URL: http://localhost:8080/v1/organizations/{organizationId}/licenses/
- Method: POST
- Parameters:
- Headers:
KEY | VALUE |
---|---|
Content-Type | application/json |
- Body (example):
{
"licenseId": "f3831f8c-c338-4ebe-a82a-e2fc1d1ff78a",
"organizationId": "e254f8c-c442-4ebe-a82a-e2fc1d1ff78a",
"productName": "CustomerPro",
"licenseType": "user",
"licenseMax": 100,
"licenseAllocated": 5,
"comment": "The default configuration"
}
- Notes
- URL: http://localhost:8080/v1/organizations/{organizationId}/licenses/{licenseId}
- Method: DELETE
-
Parameters:
- licenseId: The license ID for identifying the record needs to be deleted.
- Headers
- Body
- Notes
- licenses
- Overview
- Getting Started
-
Technical Essentials
- Autowired
- SpringData JPA
- Configuration File Auto-loading
- Configuration Encryption
- Service Discovery with Eureka
- Resiliency Patterns with Hystrix
- Configure Hystrix
- Service Gateway with Zuul
- Zuul Filters
- Protect Service with Spring Security and OAuth2
- Use JWT as Access Token
- Store Clients and Users' Credentials to DB
- Integrate with Message Queue (Kafka)
- Integrate with Redis
- Tune Logging
- Log Aggregation
- Send Trace to Zipkin
- Build Runnable Jar
- Core Application Logic
- Components