-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Backbase/ssdk/create_outbound_integration4
Open API outbound integration example.
- Loading branch information
Showing
30 changed files
with
1,004 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
service-sdk/12.1.0/.idea/ |
4 changes: 4 additions & 0 deletions
4
service-sdk/12.0.0/create-outbound-integration-service-openapi/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This project contains code samples documented in the following sections in [Backbase Community](https://community.backbase.com/documentation/ServiceSDK/latest/index) | ||
|
||
* [Integrate your service with an external service](https://community.backbase.com/documentation/ServiceSDK/latest/create_outbound_integration_service) | ||
* [Enable service to service communications](https://community.backbase.com/documentation/ServiceSDK/latest/service_to_service_communication) |
26 changes: 26 additions & 0 deletions
26
...12.0.0/create-outbound-integration-service-openapi/example-integration-service/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
**/*.iml | ||
**/*.ipr | ||
**/*.iws | ||
**/*.log | ||
**/.classpath | ||
**/.idea/ | ||
**/.project | ||
**/.settings | ||
**/target/ | ||
**/*.class | ||
|
||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
|
||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
*.code-workspace | ||
|
||
# Local History for Visual Studio Code | ||
.history/ |
45 changes: 45 additions & 0 deletions
45
...eate-outbound-integration-service-openapi/example-integration-service/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# example-integration-service | ||
|
||
_Fill out this file with some information about your Service._ | ||
|
||
#Getting Started | ||
* [Extend and build](https://community.backbase.com/documentation/ServiceSDK/latest/extend_and_build) | ||
|
||
## Dependencies | ||
|
||
Requires a running Eureka registry, by default on port 8080. | ||
|
||
## Configuration | ||
|
||
Service configuration is under `src/main/resources/application.yml`. | ||
|
||
## Running | ||
|
||
To run the service in development mode, use: | ||
- `mvn spring-boot:run` | ||
|
||
To run the service from the built binaries, use: | ||
- `java -jar target/example-integration-service-1.0.0-SNAPSHOT.jar` | ||
|
||
## Authorization | ||
|
||
Requests to this service are authorized with a Backbase Internal JWT, therefore you must access this service via the | ||
Backbase Gateway after authenticating with the authentication service. | ||
|
||
For local development, an internal JWT can be created from http://jwt.io, entering `JWTSecretKeyDontUseInProduction!` | ||
as the secret in the signature to generate a valid signed JWT. | ||
|
||
## Community Documentation | ||
|
||
Add links to documentation including setup, config, etc. | ||
|
||
## Jira Project | ||
|
||
Add link to Jira project. | ||
|
||
## Confluence Links | ||
Links to relevant confluence pages (design etc). | ||
|
||
## Support | ||
|
||
The official example-integration-service support room is [#s-example-integration-service](https://todo). |
102 changes: 102 additions & 0 deletions
102
...te-outbound-integration-service-openapi/example-integration-service/pom-as-dependency.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.3.8.RELEASE</version> | ||
<relativePath /> <!-- lookup parent from repository --> | ||
</parent> | ||
|
||
<groupId>com.backbase.example</groupId> | ||
<artifactId>example-integration-service</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
<name>Backbase :: Digital Banking Services :: example-integration-service</name> | ||
|
||
<properties> | ||
<java.version>11</java.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<version>12.1.0</version> | ||
<artifactId>service-sdk-starter-core</artifactId> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<!-- Add dependencies for your integration services, e.g. BB raml specifications, | ||
integration clients --> | ||
|
||
<!-- Uncomment the following dependency if DBS inter-service communication | ||
is needed --> | ||
<!-- <dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>communication</artifactId> | ||
</dependency> --> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>service-sdk-starter-core</artifactId> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>service-sdk-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- Optionally, use the backbase-loader-tool application launcher | ||
The backbase-loader-tool is a Spring Boot application launcher that lets | ||
you add classpath dependencies to applications packaged as bootable jars | ||
at runtime using the loader.path system property. | ||
To use the backbase-loader-tool, add the following maven plugin | ||
under project/build/plugins in your POM file: --> | ||
<!-- | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>repackage</id> | ||
<goals> | ||
<goal>build-info</goal> | ||
<goal>repackage</goal> | ||
</goals> | ||
<configuration> | ||
<classifier>boot</classifier> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<!-- Add artifact containing custom factory as plugin | ||
dependency -\\-> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>backbase-loader-tool</artifactId> | ||
<version>12.1.0</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<!-- Use custom layout factory -\\-> | ||
<layoutFactory | ||
implementation="com.backbase.boot.layout.BackbaseLayoutFactory" /> | ||
<environmentVariables> | ||
<SIG_SECRET_KEY>JWTSecretKeyDontUseInProduction!</SIG_SECRET_KEY> | ||
</environmentVariables> | ||
</configuration> | ||
</plugin> | ||
--> | ||
</plugins> | ||
</build> | ||
</project> |
132 changes: 132 additions & 0 deletions
132
...dk/12.0.0/create-outbound-integration-service-openapi/example-integration-service/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<!-- The simplest way to build a service with service-sdk-starter-core | ||
is to use it as a parent in your project’s POM file, alternatively if you | ||
don’t want to use service-sdk-starter-core as your project’s parent, you | ||
can declare it as a dependency instead, see pom-as-dependency.xml --> | ||
<parent> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<version>12.1.0</version> | ||
<artifactId>service-sdk-starter-core</artifactId> | ||
<relativePath /> | ||
</parent> | ||
|
||
<groupId>com.backbase.example</groupId> | ||
<artifactId>example-integration-service</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
<name>Backbase :: example-integration-service</name> | ||
|
||
<properties> | ||
<java.version>11</java.version> | ||
<boat-maven-plugin.version>0.14.1</boat-maven-plugin.version> | ||
<open-api-specs-dir>${project.build.directory}/specs</open-api-specs-dir> | ||
<!-- required for generated api --> | ||
<swagger-annotations.version>1.6.2</swagger-annotations.version> | ||
<jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>service-sdk-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Add dependencies for your services, e.g. API Specs, integration clients --> | ||
|
||
<!-- Uncomment the following dependency if DBS inter-service communication is needed --> | ||
<!-- tag::spec-and-dependency[] --> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>communication</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>service-sdk-starter-mapping</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.backbase.buildingblocks</groupId> | ||
<artifactId>service-sdk-test-utils</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.swagger</groupId> | ||
<artifactId>swagger-annotations</artifactId> | ||
<version>${swagger-annotations.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>jackson-databind-nullable</artifactId> | ||
<version>${jackson-databind-nullable.version}</version> | ||
</dependency> | ||
<!-- end::spec-and-dependency[] --> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- tag::maven-plugin[] --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>3.1.2</version> | ||
<executions> | ||
<execution> | ||
<id>unpack</id> | ||
<phase>initialize</phase> | ||
<goals> | ||
<goal>unpack</goal> | ||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>com.backbase.poc</groupId> | ||
<artifactId>example-integration-spec</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<type>jar</type> | ||
<outputDirectory>${open-api-specs-dir}/example-integration-spec/</outputDirectory> | ||
<includes>**/*.yaml,**/*.json</includes> | ||
</artifactItem> | ||
</artifactItems> | ||
<includes>**/*.java</includes> | ||
<excludes>**/*.properties</excludes> | ||
<outputDirectory>${project.build.directory}/wars</outputDirectory> | ||
<overWriteReleases>false</overWriteReleases> | ||
<overWriteSnapshots>true</overWriteSnapshots> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- end::maven-plugin[] --> | ||
|
||
<!-- tag::boat-plugin[] --> | ||
<plugin> | ||
<groupId>com.backbase.oss</groupId> | ||
<artifactId>boat-maven-plugin</artifactId> | ||
<version>${boat-maven-plugin.version}</version> | ||
<executions> | ||
<!-- Generate OpenAPI interface stubs. --> | ||
<execution> | ||
<id>generate-payment-order-template-client-api-code</id> | ||
<goals> | ||
<goal>generate-spring-boot-embedded</goal> | ||
</goals> | ||
<phase>generate-sources</phase> | ||
<configuration> | ||
<inputSpec> | ||
${open-api-specs-dir}/example-integration-spec/client-api-v1.yaml | ||
</inputSpec> | ||
<apiPackage>com.backbase.example.api.client.v1</apiPackage> | ||
<modelPackage>com.backbase.example.api.client.v1.model</modelPackage> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- end::boat-plugin[] --> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
16 changes: 16 additions & 0 deletions
16
...e-openapi/example-integration-service/src/main/java/com/backbase/example/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.backbase.example; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
|
||
@SpringBootApplication | ||
@EnableDiscoveryClient | ||
public class Application extends SpringBootServletInitializer { | ||
|
||
public static void main(final String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
...api/example-integration-service/src/main/java/com/backbase/example/ExampleController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.backbase.example; | ||
|
||
import com.backbase.buildingblocks.presentation.errors.InternalServerErrorException; | ||
import com.backbase.example.api.client.v1.MessageApi; | ||
import com.backbase.example.api.client.v1.model.MessagePostResponseBody; | ||
import com.backbase.example.integration.MessageClient; | ||
import com.backbase.example.mapper.IntegrationMessageMapper; | ||
import com.backbase.example.model.Message; | ||
import java.io.IOException; | ||
import java.util.List; | ||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class ExampleController implements MessageApi { | ||
|
||
@Autowired | ||
private MessageClient messageClient; | ||
|
||
@Override | ||
public ResponseEntity<Void> deleteMessage(@Valid @NotNull String id) { | ||
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); | ||
} | ||
|
||
|
||
@Override | ||
public ResponseEntity<com.backbase.example.api.client.v1.model.Message> getMessage(@Valid @NotNull String id) { | ||
|
||
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); | ||
} | ||
|
||
// tag::getIntegration[] | ||
@Override | ||
public ResponseEntity<List<com.backbase.example.api.client.v1.model.Message>> getMessages() { | ||
List<Message> messages = null; | ||
|
||
try { | ||
messages = messageClient.getMessages(); | ||
} catch (IOException e) { | ||
throw new InternalServerErrorException("Error has occurred sending message"); | ||
} | ||
|
||
return ResponseEntity.ok(IntegrationMessageMapper.INSTANCE.messagesToIntegrationGetResponseBodys(messages)); | ||
} | ||
// end::getIntegration[] | ||
|
||
@Override | ||
public ResponseEntity<MessagePostResponseBody> postMessage( | ||
com.backbase.example.api.client.v1.model.@Valid Message message) { | ||
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<Void> putMessage(com.backbase.example.api.client.v1.model.@Valid Message message) { | ||
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); | ||
} | ||
|
||
} |
Oops, something went wrong.