diff --git a/CHANGELOG.md b/CHANGELOG.md
index acbe25b58..1357d1e4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,41 @@
# Changelog
All notable changes to this project will be documented in this file.
+## [3.63.0](https://github.com/Backbase/stream-services/compare/3.62.0...3.63.0)
+### Changed
+- Enabling service discovery for stream composition components, direct endpoint urls were removed.
+- To use static uri settings, configure it as the following example:
+```yaml
+backbase:
+ communication:
+ services:
+ stream:
+ legal-entity:
+ integration:
+ direct-uri: http://legal-entity-integration:8080
+ product:
+ integration:
+ direct-uri: http://product-integration:8080
+ composition:
+ direct-uri: http://product-composition:8080
+ product-catalog:
+ integration:
+ direct-uri: http://product-catalog-ingestion-integration:8080
+ payment-order:
+ integration:
+ direct-uri: http://payment-order-integration:8080
+ composition:
+ direct-uri: http://payment-order-composition:8080
+ transaction:
+ composition:
+ direct-uri: http://transaction-composition:8080
+ cursor:
+ direct-uri: http://transaction-cursor:8080
+ integration:
+ direct-uri: http://transaction-integration:8080
+```
+> To keep it retro-compatible you also need to set: `spring.cloud.loadbalancer.enabled=false`
+
## [3.62.0](https://github.com/Backbase/stream-services/compare/3.61.0...3.62.0)
### Added
- Secondary Service Agreement update
diff --git a/e2e-tests/.env b/e2e-tests/.env
index 91af3fdb0..b60bca58e 100644
--- a/e2e-tests/.env
+++ b/e2e-tests/.env
@@ -1,2 +1,2 @@
-BB_VERSION=2023.01.9
-STREAM_VERSION=3.30.1
+BB_VERSION=2023.02.52-LTS
+STREAM_VERSION=3.63.0
diff --git a/e2e-tests/docker-compose.yaml b/e2e-tests/docker-compose.yaml
index 5df74678c..e425a01fe 100644
--- a/e2e-tests/docker-compose.yaml
+++ b/e2e-tests/docker-compose.yaml
@@ -1,12 +1,16 @@
-version: "3.9"
# https://docs.docker.com/compose/compose-file/
x-common-variables: &common-variables
- JAVA_TOOL_OPTIONS: -XX:MaxRAMPercentage=60.0 -Dlogging.level.com.backbase=DEBUG
+ JAVA_TOOL_OPTIONS: -XX:MaxRAMPercentage=60.0
SIG_SECRET_KEY: JWTSecretKeyDontUseInProduction!
USERCTX_KEY: JWTSecretKeyDontUseInProduction!
+ logging.level.com.backbase: DEBUG
+ logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter: DEBUG
+ server.shutdown: graceful
eureka.client.serviceUrl.defaultZone: http://registry:8080/eureka
eureka.client.healthcheck.enabled: true
+ eureka.client.registry-fetch-interval-seconds: 15
+ eureka.client.instance-info-replication-interval-seconds: 15
eureka.instance.non-secure-port: 8080
eureka.instance.initialStatus: STARTING
backbase.activemq.enabled: false
@@ -30,20 +34,19 @@ x-database-variables: &database-variables
x-healthcheck-defaults: &healthcheck-defaults
start_period: 60s
- interval: 30s
+ interval: 15s
timeout: 5s
- retries: 10
+ retries: 15
+
+name: stream
services:
mysql:
- container_name: stream_mysql
image: mysql:8.0.31
- ports:
- - "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- - stream_mysql_data:/var/lib/mysql
+ - mysql_data:/var/lib/mysql
- ./mysql:/docker-entrypoint-initdb.d:rw
healthcheck:
test: mysqladmin ping --silent
@@ -52,10 +55,7 @@ services:
retries: 5
registry:
- container_name: stream_registry
image: repo.backbase.com/backbase-docker-releases/registry:${BB_VERSION}
- ports:
- - "8761:8080"
volumes:
- ./utils/HealthCheck.java:/tmp/HealthCheck.java
healthcheck:
@@ -63,10 +63,7 @@ services:
test: [ "CMD", "java", "/tmp/HealthCheck.java" ]
token-converter:
- container_name: stream_token_converter
image: repo.backbase.com/backbase-docker-releases/oidc-token-converter-service:${BB_VERSION}
- ports:
- - "7779:8080"
environment:
<<: *common-variables
BACKBASE_OIDCTOKENCONVERTER_WHITELISTEDDOMAINS_0_INTERNALHOSTSCHEME: http
@@ -83,10 +80,7 @@ services:
- identity
identity:
- container_name: stream_identity
image: repo.backbase.com/backbase-docker-releases/backbase-identity:${BB_VERSION}
- ports:
- - '8180:8080'
environment:
QUARKUS_DATASOURCE_URL: "jdbc:mysql://mysql:3306/backbase_identity?useSSL=false&allowPublicKeyRetrieval=true&cacheServerConfiguration=true&createDatabaseIfNotExist=true"
QUARKUS_DATASOURCE_USERNAME: "root"
@@ -116,13 +110,9 @@ services:
condition: service_healthy
access-control:
- container_name: stream_access_control
image: repo.backbase.com/backbase-docker-releases/access-control:${BB_VERSION}
- ports:
- - "8040:8080"
environment:
- <<: *common-variables
- <<: *database-variables
+ <<: [*common-variables, *database-variables]
backbase.multi-tenancy.datasource.default-catalog: t1_access_control
backbase.multi-tenancy.tenants[0].catalog: t1_access_control
backbase.multi-tenancy.tenants[1].catalog: t2_access_control
@@ -138,13 +128,9 @@ services:
- registry
user-manager:
- container_name: stream_user_manager
image: repo.backbase.com/backbase-docker-releases/user-manager:${BB_VERSION}
- ports:
- - "8060:8080"
environment:
- <<: *common-variables
- <<: *database-variables
+ <<: [*common-variables, *database-variables]
backbase.multi-tenancy.datasource.default-catalog: t1_user_manager
backbase.multi-tenancy.tenants[0].catalog: t1_user_manager
backbase.multi-tenancy.tenants[1].catalog: t2_user_manager
@@ -163,10 +149,7 @@ services:
- registry
identity-integration-service:
- container_name: stream_identity_integration_service
image: repo.backbase.com/backbase-docker-releases/identity-integration-service:${BB_VERSION}
- ports:
- - "8070:8080"
environment:
<<: *common-variables
IDENTITY_SERVERURL: http://identity:8080/auth
@@ -183,7 +166,6 @@ services:
- registry
legal-entity-bootstrap-task:
- container_name: stream_legal_entity_bootstrap_task
image: repo.backbase.com/backbase-stream-images/legal-entity-bootstrap-task:${STREAM_VERSION}
environment:
<<: *common-variables
@@ -202,11 +184,10 @@ services:
identity:
condition: service_healthy
- legal-entity-composition-service:
- container_name: stream_legal_entity_composition
+ legal-entity-composition:
image: repo.backbase.com/backbase-stream-images/legal-entity-composition-service:${STREAM_VERSION}
ports:
- - "8050:8080"
+ - "8989:8080"
environment:
<<: *common-variables
bootstrap.enabled: true
@@ -215,7 +196,7 @@ services:
- ./utils/HealthCheck.java:/tmp/HealthCheck.java
healthcheck:
<<: *healthcheck-defaults
- test: [ "CMD", "java", "/tmp/HealthCheck.java", "http://localhost:8080/actuator/health" ]
+ test: [ "CMD", "java", "/tmp/HealthCheck.java", "http://registry:8080/eureka/apps/legal-entity-composition" ]
depends_on:
token-converter:
condition: service_healthy
@@ -229,7 +210,7 @@ services:
condition: service_healthy
volumes:
- stream_mysql_data:
+ mysql_data:
driver: local
networks:
diff --git a/pom.xml b/pom.xml
index 99018b961..1047f9d22 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.backbase.buildingblocks
backbase-parent
- 15.2.2
+ 15.2.3
@@ -38,7 +38,7 @@
17
- 15.2.2
+ 15.2.3
2023.06.2
0.16.6
true
diff --git a/stream-compositions/cursors/transaction-cursor/pom.xml b/stream-compositions/cursors/transaction-cursor/pom.xml
index 6536054ac..a2b41ebeb 100644
--- a/stream-compositions/cursors/transaction-cursor/pom.xml
+++ b/stream-compositions/cursors/transaction-cursor/pom.xml
@@ -46,6 +46,18 @@
org.springframework.boot
spring-boot-starter-security
+
+ com.backbase.buildingblocks
+ service-sdk-starter-eureka-client
+
+
+ org.springframework.cloud
+ spring-cloud-starter-kubernetes-fabric8
+
+
+ org.springframework.cloud
+ spring-cloud-starter-kubernetes-fabric8-loadbalancer
+
com.backbase.stream.compositions.api
transaction-cursor-api
diff --git a/stream-compositions/pom.xml b/stream-compositions/pom.xml
index 7167e757c..b95cb77bb 100644
--- a/stream-compositions/pom.xml
+++ b/stream-compositions/pom.xml
@@ -7,7 +7,7 @@
com.backbase.buildingblocks
service-sdk-starter-reactive
- 15.2.2
+ 15.2.3
@@ -23,7 +23,7 @@
false
**/test/**/*
2.1.3
- 15.2.2
+ 15.2.3
/tmp
diff --git a/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfiguration.java b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfiguration.java
index ec3c4f9a9..1a5ee96d8 100644
--- a/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfiguration.java
+++ b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfiguration.java
@@ -1,70 +1,17 @@
package com.backbase.stream.compositions.legalentity.core.config;
-import com.backbase.buildingblocks.webclient.WebClientConstants;
-import com.backbase.stream.compositions.legalentity.integration.client.LegalEntityIntegrationApi;
-import com.backbase.stream.compositions.product.ApiClient;
-import com.backbase.stream.compositions.product.client.ProductCompositionApi;
-import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-import org.springframework.http.MediaType;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
@Configuration
@AllArgsConstructor
-@EnableConfigurationProperties({
- LegalEntityConfigurationProperties.class
-})
+@EnableConfigurationProperties(LegalEntityConfigurationProperties.class)
public class LegalEntityConfiguration {
- private final LegalEntityConfigurationProperties legalEntityConfigurationProperties;
-
- @Bean
- @Primary
- public LegalEntityIntegrationApi legalEntityIntegrationApi(
- com.backbase.stream.compositions.legalentity.integration.ApiClient legalEntityClient) {
- return new LegalEntityIntegrationApi(legalEntityClient);
- }
-
- @Bean
- @Primary
- public ProductCompositionApi productCompositionApi(ApiClient productClient) {
- return new ProductCompositionApi(productClient);
- }
-
- @Bean
- public ApiClient productClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- ApiClient apiClient = new ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(
- legalEntityConfigurationProperties.getChains().getProductComposition().getBaseUrl());
-
- return apiClient;
- }
-
- @Bean
- public com.backbase.stream.compositions.legalentity.integration.ApiClient legalEntityClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- com.backbase.stream.compositions.legalentity.integration.ApiClient apiClient =
- new com.backbase.stream.compositions.legalentity.integration.ApiClient(
- dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(legalEntityConfigurationProperties.getIntegrationBaseUrl());
-
- return apiClient;
- }
-
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
return http.csrf().disable().build();
diff --git a/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationProperties.java b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationProperties.java
index f6398b9d0..beb8ac640 100644
--- a/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationProperties.java
+++ b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationProperties.java
@@ -13,7 +13,6 @@
@ConfigurationProperties("backbase.stream.compositions.legal-entity")
public class LegalEntityConfigurationProperties {
- private String integrationBaseUrl = "http://legal-entity-integration:9000";
private Chains chains = new Chains();
private Events events = new Events();
private Cursor cursor = new Cursor();
@@ -22,6 +21,7 @@ public class LegalEntityConfigurationProperties {
@Data
@NoArgsConstructor
public static class Events {
+
private Boolean enableCompleted = Boolean.FALSE;
private Boolean enableFailed = Boolean.FALSE;
}
@@ -29,21 +29,22 @@ public static class Events {
@Data
@NoArgsConstructor
public static class Cursor {
+
private Boolean enabled = Boolean.FALSE;
- private String baseUrl = "http://legal-entity-cursor:9000";
}
@Data
@NoArgsConstructor
public static class Chains {
+
private Boolean includeSubsidiaries = Boolean.FALSE;
private ProductComposition productComposition = new ProductComposition();
}
@Data
public static abstract class BaseComposition {
+
private Boolean enabled = Boolean.FALSE;
- private String baseUrl = "http://localhost:9002/";
private Boolean async = Boolean.FALSE;
}
@@ -55,6 +56,7 @@ public static class ProductComposition extends BaseComposition {
@Data
@NoArgsConstructor
public static class IngestionMode {
+
private BatchProductIngestionMode.FunctionGroupsMode functionGroups = BatchProductIngestionMode.FunctionGroupsMode.UPSERT;
private BatchProductIngestionMode.DataGroupsMode dataGroups = BatchProductIngestionMode.DataGroupsMode.UPSERT;
private BatchProductIngestionMode.ArrangementsMode arrangements = BatchProductIngestionMode.ArrangementsMode.UPSERT;
@@ -78,9 +80,9 @@ public boolean isProductChainAsync() {
public BatchProductIngestionMode ingestionMode() {
return BatchProductIngestionMode.builder()
- .functionGroupsMode(ingestionMode.getFunctionGroups())
- .dataGroupIngestionMode(ingestionMode.getDataGroups())
- .arrangementsMode(ingestionMode.getArrangements())
- .build();
+ .functionGroupsMode(ingestionMode.getFunctionGroups())
+ .dataGroupIngestionMode(ingestionMode.getDataGroups())
+ .arrangementsMode(ingestionMode.getArrangements())
+ .build();
}
}
diff --git a/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityIntegrationClientConfiguration.java b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityIntegrationClientConfiguration.java
new file mode 100644
index 000000000..32fcee37e
--- /dev/null
+++ b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityIntegrationClientConfiguration.java
@@ -0,0 +1,35 @@
+package com.backbase.stream.compositions.legalentity.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.legalentity.integration.ApiClient;
+import com.backbase.stream.compositions.legalentity.integration.client.LegalEntityIntegrationApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.legal-entity.integration")
+public class LegalEntityIntegrationClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "legal-entity-integration";
+
+ public LegalEntityIntegrationClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient legalEntityClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public LegalEntityIntegrationApi legalEntityIntegrationApi(ApiClient legalEntityClient) {
+ return new LegalEntityIntegrationApi(legalEntityClient);
+ }
+
+}
diff --git a/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/ProductCompositionClientConfiguration.java b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/ProductCompositionClientConfiguration.java
new file mode 100644
index 000000000..83107af1f
--- /dev/null
+++ b/stream-compositions/services/legal-entity-composition-service/src/main/java/com/backbase/stream/compositions/legalentity/core/config/ProductCompositionClientConfiguration.java
@@ -0,0 +1,35 @@
+package com.backbase.stream.compositions.legalentity.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.product.ApiClient;
+import com.backbase.stream.compositions.product.client.ProductCompositionApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.product.composition")
+public class ProductCompositionClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "product-composition";
+
+ public ProductCompositionClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient productClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public ProductCompositionApi productCompositionApi(ApiClient productClient) {
+ return new ProductCompositionApi(productClient);
+ }
+
+}
diff --git a/stream-compositions/services/legal-entity-composition-service/src/main/resources/application-local.yml b/stream-compositions/services/legal-entity-composition-service/src/main/resources/application-local.yml
index d54663253..016d329c8 100644
--- a/stream-compositions/services/legal-entity-composition-service/src/main/resources/application-local.yml
+++ b/stream-compositions/services/legal-entity-composition-service/src/main/resources/application-local.yml
@@ -29,6 +29,13 @@ backbase:
identity:
integration:
direct-uri: http://localhost:8070
+ stream:
+ legal-entity:
+ integration:
+ direct-uri: http://localhost:7001
+ product:
+ composition:
+ direct-uri: http://localhost:9003
http:
client-secret: bb-secret
client-id: bb-client
@@ -41,18 +48,15 @@ backbase:
serviceAgreementUpdateEnabled: false
compositions:
legal-entity:
- integration-base-url: http://localhost:7001
chains:
product-composition:
enabled: false
- base-url: http://localhost:9003
async: false
events:
enableCompleted: false
enableFailed: false
cursor:
enabled: false
- base-url: http://localhost:9005
bootstrap:
enabled: true
diff --git a/stream-compositions/services/legal-entity-composition-service/src/main/resources/application.yml b/stream-compositions/services/legal-entity-composition-service/src/main/resources/application.yml
index aaf86e534..cb5cca948 100644
--- a/stream-compositions/services/legal-entity-composition-service/src/main/resources/application.yml
+++ b/stream-compositions/services/legal-entity-composition-service/src/main/resources/application.yml
@@ -24,19 +24,16 @@ backbase:
serviceAgreementUpdateEnabled: false
compositions:
legal-entity:
- integration-base-url: http://legal-entity-integration:8080
chains:
include-subsidiaries: false
product-composition:
enabled: true
- base-url: http://product-composition:8080
async: false
events:
enableCompleted: true
enableFailed: true
cursor:
enabled: false
- base-url: http://legal-entity-cursor:8080
bootstrap:
enabled: false
# This is just an example. Replace it with data corresponding to your bank
diff --git a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationPropertiesTest.java b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationPropertiesTest.java
index 158a3c480..3645d749b 100644
--- a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationPropertiesTest.java
+++ b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/config/LegalEntityConfigurationPropertiesTest.java
@@ -16,11 +16,9 @@ class LegalEntityConfigurationPropertiesTest {
@Test
void test() {
LegalEntityConfigurationProperties properties = new LegalEntityConfigurationProperties();
- properties.setIntegrationBaseUrl("https://legal-entity");
Chains chains = new Chains();
ProductComposition productComposition = new ProductComposition();
- productComposition.setBaseUrl("https://product-composition");
productComposition.setEnabled(Boolean.TRUE);
productComposition.setAsync(Boolean.TRUE);
chains.setProductComposition(productComposition);
@@ -30,22 +28,15 @@ void test() {
events.setEnableFailed(Boolean.TRUE);
Cursor cursor = new Cursor();
- cursor.setBaseUrl("https://cursor");
cursor.setEnabled(Boolean.TRUE);
properties.setChains(chains);
properties.setEvents(events);
properties.setCursor(cursor);
- assertTrue(properties.getIntegrationBaseUrl().contains("legal-entity"),
- "Correct config spotted");
- assertTrue(
- properties.getChains().getProductComposition().getBaseUrl().contains("product-composition"),
- "Correct config spotted");
assertTrue(properties.getEvents().getEnableCompleted());
assertTrue(properties.getEvents().getEnableFailed());
assertTrue(properties.getCursor().getEnabled());
- assertTrue(properties.getCursor().getBaseUrl().contains("cursor"), "Correct config spotted");
assertTrue(properties.isCompletedEventEnabled());
assertTrue(properties.isFailedEventEnabled());
assertTrue(properties.isProductChainEnabled());
diff --git a/stream-compositions/services/legal-entity-composition-service/src/test/resources/application.yml b/stream-compositions/services/legal-entity-composition-service/src/test/resources/application.yml
index 79b424b22..d8b52b3c4 100644
--- a/stream-compositions/services/legal-entity-composition-service/src/test/resources/application.yml
+++ b/stream-compositions/services/legal-entity-composition-service/src/test/resources/application.yml
@@ -11,7 +11,9 @@ spring:
enabled: false
enabled: false
discovery:
- enabled: true
+ enabled: false
+ loadbalancer:
+ enabled: false
eureka:
client:
@@ -44,6 +46,13 @@ backbase:
identity:
integration:
direct-uri: http://localhost:8181/identity-integration-service
+ stream:
+ legal-entity:
+ integration:
+ direct-uri: http://localhost:18000
+ product:
+ composition:
+ direct-uri: http://localhost:9003
http:
client-secret: bb-secret
client-id: bb-client
@@ -55,19 +64,16 @@ backbase:
userProfileEnabled: true
compositions:
legal-entity:
- integration-base-url: http://localhost:18000
chains:
product-composition:
enableOnComplete: true
enableOnFailure: false
- base-url: http://localhost:9003
async: false
events:
enableCompleted: false
enableFailed: false
cursor:
enabled: false
- base-url: http://localhost:9005
bootstrap:
enabled: false
# This is just an example. Replace it with data corresponding to your bank
diff --git a/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfiguration.java b/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfiguration.java
index cef056ef5..6a6ad7ced 100644
--- a/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfiguration.java
+++ b/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfiguration.java
@@ -1,26 +1,26 @@
package com.backbase.stream.compositions.paymentorders.core.config;
-import com.backbase.buildingblocks.webclient.WebClientConstants;
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
import com.backbase.stream.compositions.paymentorder.integration.ApiClient;
import com.backbase.stream.compositions.paymentorder.integration.client.PaymentOrderIntegrationApi;
import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
@Configuration
-@AllArgsConstructor
-@EnableConfigurationProperties(PaymentOrderConfigurationProperties.class)
-public class PaymentOrderCompositionConfiguration {
- private final PaymentOrderConfigurationProperties paymentOrderConfigurationProperties;
+@ConfigurationProperties("backbase.communication.services.stream.payment-order.integration")
+public class PaymentOrderCompositionConfiguration extends CompositeApiClientConfig {
+
+ private static final String SERVICE_ID = "payment-order-integration";
+
+ public PaymentOrderCompositionConfiguration() {
+ super(SERVICE_ID);
+ }
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
@@ -34,13 +34,8 @@ public PaymentOrderIntegrationApi paymentOrderIntegrationApi(ApiClient paymentOr
}
@Bean
- public ApiClient paymentOrderIntegrationClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- ApiClient apiClient = new ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(paymentOrderConfigurationProperties.getIntegrationBaseUrl());
-
- return apiClient;
+ public ApiClient paymentOrderIntegrationClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
}
}
diff --git a/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderConfigurationProperties.java b/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderConfigurationProperties.java
deleted file mode 100644
index ad83beee8..000000000
--- a/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderConfigurationProperties.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.backbase.stream.compositions.paymentorders.core.config;
-
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@Setter
-@Getter
-@NoArgsConstructor
-@ConfigurationProperties("backbase.stream.compositions.paymentorder")
-public class PaymentOrderConfigurationProperties {
- private String integrationBaseUrl = "http://payment-orders-ingestion-integration:8080";
-}
diff --git a/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderPostIngestionServiceImpl.java b/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderPostIngestionServiceImpl.java
index eafc0a6cc..36fc5f3eb 100644
--- a/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderPostIngestionServiceImpl.java
+++ b/stream-compositions/services/payment-order-composition-service/src/main/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderPostIngestionServiceImpl.java
@@ -1,25 +1,20 @@
package com.backbase.stream.compositions.paymentorders.core.service.impl;
-import java.util.List;
-
-import org.springframework.stereotype.Service;
-
import com.backbase.buildingblocks.backend.communication.event.proxy.EventBus;
-import com.backbase.stream.compositions.paymentorders.core.config.PaymentOrderConfigurationProperties;
import com.backbase.stream.compositions.paymentorders.core.service.PaymentOrderPostIngestionService;
import com.backbase.stream.model.response.PaymentOrderIngestDbsResponse;
-
+import java.util.List;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
@Service
@Slf4j
@AllArgsConstructor
public class PaymentOrderPostIngestionServiceImpl implements PaymentOrderPostIngestionService {
- private final EventBus eventBus;
- private final PaymentOrderConfigurationProperties paymentOrderConfigurationProperties;
+ private final EventBus eventBus;
@Override
public void handleSuccess(List paymentOrderIngestDbsResponses) {
diff --git a/stream-compositions/services/payment-order-composition-service/src/main/resources/application-local.yml b/stream-compositions/services/payment-order-composition-service/src/main/resources/application-local.yml
index ded95238c..4d333b139 100644
--- a/stream-compositions/services/payment-order-composition-service/src/main/resources/application-local.yml
+++ b/stream-compositions/services/payment-order-composition-service/src/main/resources/application-local.yml
@@ -29,6 +29,10 @@ backbase:
transaction:
manager:
direct-uri: http://localhost:8083
+ stream:
+ payment-order:
+ integration:
+ direct-uri: http://localhost:7004
http:
client-secret: bb-secret
client-id: bb-client
@@ -39,9 +43,6 @@ backbase:
paymentorder:
worker:
deletePaymentOrder: false
- compositions:
- paymentorder:
- integration-base-url: http://localhost:7004
eureka:
instance:
diff --git a/stream-compositions/services/payment-order-composition-service/src/main/resources/application.yml b/stream-compositions/services/payment-order-composition-service/src/main/resources/application.yml
index f5f6ecb69..6c65a91cd 100644
--- a/stream-compositions/services/payment-order-composition-service/src/main/resources/application.yml
+++ b/stream-compositions/services/payment-order-composition-service/src/main/resources/application.yml
@@ -34,6 +34,3 @@ backbase:
paymentorder:
worker:
deletePaymentOrder: false
- compositions:
- paymentorder:
- integration-base-url: http://payment-order-integration:8080
diff --git a/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfigurationTest.java b/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfigurationTest.java
deleted file mode 100644
index 3c5075035..000000000
--- a/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/config/PaymentOrderCompositionConfigurationTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.backbase.stream.compositions.paymentorders.core.config;
-
-import com.backbase.stream.compositions.paymentorder.integration.ApiClient;
-import com.backbase.stream.compositions.paymentorder.integration.client.PaymentOrderIntegrationApi;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-@ExtendWith(MockitoExtension.class)
-class PaymentOrderCompositionConfigurationTest {
-
- @Mock
- private WebClient webClient;
-
- @Mock
- private ObjectMapper objectMapper;
-
- @Mock
- private DateFormat dateFormat;
-
- @Mock
- private PaymentOrderConfigurationProperties properties;
-
- private ApiClient paymentOrderIntegrationClient;
-
- private PaymentOrderIntegrationApi paymentOrderIntegrationApi;
-
- @BeforeEach
- void init() {
-
- Mockito.when(properties.getIntegrationBaseUrl()).thenReturn("https://payment-order-integration");
-
- paymentOrderIntegrationClient = new ApiClient(webClient, objectMapper, dateFormat);
- paymentOrderIntegrationClient.setBasePath(properties.getIntegrationBaseUrl());
-
- paymentOrderIntegrationApi = new PaymentOrderIntegrationApi(paymentOrderIntegrationClient);
-
- }
-
- @Test
- void testCompositionConfig() {
- PaymentOrderCompositionConfiguration config = new PaymentOrderCompositionConfiguration(properties);
-
- assertNotNull(config.paymentOrderIntegrationApi(paymentOrderIntegrationClient));
- assertNotNull(config.paymentOrderIntegrationApi(paymentOrderIntegrationClient).getApiClient());
- assertNotNull(config.paymentOrderIntegrationApi(paymentOrderIntegrationClient).getApiClient().getBasePath());
- assertEquals("https://payment-order-integration",
- config.paymentOrderIntegrationApi(paymentOrderIntegrationClient).getApiClient().getBasePath());
-
- }
-
-}
\ No newline at end of file
diff --git a/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderIngestionServiceImplTest.java b/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderIngestionServiceImplTest.java
index 94786b9bf..7fb312946 100644
--- a/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderIngestionServiceImplTest.java
+++ b/stream-compositions/services/payment-order-composition-service/src/test/java/com/backbase/stream/compositions/paymentorders/core/service/impl/PaymentOrderIngestionServiceImplTest.java
@@ -3,24 +3,10 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Stream;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mapstruct.factory.Mappers;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
import com.backbase.buildingblocks.backend.communication.event.proxy.EventBus;
import com.backbase.dbs.paymentorder.api.service.v2.model.PaymentOrderPostRequest;
import com.backbase.dbs.paymentorder.api.service.v2.model.PaymentOrderPutRequest;
import com.backbase.stream.PaymentOrderService;
-import com.backbase.stream.compositions.paymentorders.core.config.PaymentOrderConfigurationProperties;
import com.backbase.stream.compositions.paymentorders.core.mapper.PaymentOrderMapper;
import com.backbase.stream.compositions.paymentorders.core.model.PaymentOrderIngestPullRequest;
import com.backbase.stream.compositions.paymentorders.core.model.PaymentOrderIngestPushRequest;
@@ -35,7 +21,17 @@
import com.backbase.stream.model.response.PaymentOrderIngestDbsResponse;
import com.backbase.stream.paymentorder.PaymentOrderTask;
import com.backbase.stream.worker.model.UnitOfWork;
-
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mapstruct.factory.Mappers;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
@@ -63,12 +59,9 @@ class PaymentOrderIngestionServiceImplTest {
@Mock
EventBus eventBus;
- @Mock
- PaymentOrderConfigurationProperties config;
-
@BeforeEach
void setUp() {
- paymentOrderPostIngestionService = new PaymentOrderPostIngestionServiceImpl(eventBus, config);
+ paymentOrderPostIngestionService = new PaymentOrderPostIngestionServiceImpl(eventBus);
paymentOrderIngestionService = new PaymentOrderIngestionServiceImpl(
paymentOrderIntegrationService,
diff --git a/stream-compositions/services/payment-order-composition-service/src/test/resources/application.yml b/stream-compositions/services/payment-order-composition-service/src/test/resources/application.yml
index 65000c03d..f238e04f0 100644
--- a/stream-compositions/services/payment-order-composition-service/src/test/resources/application.yml
+++ b/stream-compositions/services/payment-order-composition-service/src/test/resources/application.yml
@@ -7,7 +7,9 @@ spring:
enabled: false
enabled: false
discovery:
- enabled: true
+ enabled: false
+ loadbalancer:
+ enabled: false
activemq:
broker-url: vm://activemq
main:
@@ -38,6 +40,10 @@ backbase:
transaction:
manager:
direct-uri: http://localhost:8083/transaction-manager
+ stream:
+ payment-order:
+ integration:
+ direct-uri: http://localhost:18000
http:
client-secret: bb-secret
client-id: bb-client
@@ -50,10 +56,6 @@ backbase:
service-api:
authentication:
required-scope: api:service
- stream:
- compositions:
- paymentorder:
- integration-base-url: http://localhost:18000
logging:
level:
diff --git a/stream-compositions/services/pom.xml b/stream-compositions/services/pom.xml
index 52d15e7ff..5c9bfbf4f 100644
--- a/stream-compositions/services/pom.xml
+++ b/stream-compositions/services/pom.xml
@@ -33,12 +33,28 @@
org.springframework.boot
spring-boot-starter-security
+
+ org.springframework.cloud
+ spring-cloud-starter-kubernetes-fabric8
+
+
+ org.springframework.cloud
+ spring-cloud-starter-kubernetes-fabric8-loadbalancer
+
+
+ com.backbase.buildingblocks
+ service-sdk-starter-eureka-client
+
com.backbase.buildingblocks
events
+
+ com.backbase.buildingblocks
+ service-sdk-starter-mapping
+
@@ -69,11 +85,6 @@
reactor-test
test
-
-
- com.backbase.buildingblocks
- service-sdk-starter-mapping
-
diff --git a/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfiguration.java b/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfiguration.java
index c57e302fd..b99041413 100644
--- a/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfiguration.java
+++ b/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfiguration.java
@@ -1,11 +1,11 @@
package com.backbase.stream.compositions.productcatalog.core.config;
-import com.backbase.buildingblocks.webclient.WebClientConstants;
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
import com.backbase.stream.compositions.integration.productcatalog.ApiClient;
import com.backbase.stream.compositions.integration.productcatalog.api.ProductCatalogIntegrationApi;
import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Qualifier;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -13,16 +13,18 @@
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
@Configuration
-@AllArgsConstructor
@EnableWebFluxSecurity
@EnableConfigurationProperties(ProductCatalogConfigurationProperties.class)
-public class ProductCatalogConfiguration {
- private final ProductCatalogConfigurationProperties properties;
+@ConfigurationProperties("backbase.communication.services.stream.product-catalog.integration")
+public class ProductCatalogConfiguration extends CompositeApiClientConfig {
+
+ private static final String SERVICE_ID = "product-catalog-ingestion-integration";
+
+ public ProductCatalogConfiguration() {
+ super(SERVICE_ID);
+ }
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
@@ -36,13 +38,8 @@ public ProductCatalogIntegrationApi productCatalogIntegrationApi(ApiClient legal
}
@Bean
- public ApiClient productCatalogClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- ApiClient apiClient = new ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(properties.getProductCatalogIntegrationUrl());
-
- return apiClient;
+ public ApiClient productCatalogClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
}
}
diff --git a/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationProperties.java b/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationProperties.java
index 5a6f4ad74..6103e2086 100644
--- a/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationProperties.java
+++ b/stream-compositions/services/product-catalog-composition-service/src/main/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationProperties.java
@@ -10,7 +10,7 @@
@NoArgsConstructor
@ConfigurationProperties("backbase.stream.compositions.product-catalog")
public class ProductCatalogConfigurationProperties {
+
private Boolean enableCompletedEvents = true;
private Boolean enableFailedEvents = true;
- private String productCatalogIntegrationUrl = "http://product-catalog-ingestion-integration:8080";
}
diff --git a/stream-compositions/services/product-catalog-composition-service/src/main/resources/application-local.yml b/stream-compositions/services/product-catalog-composition-service/src/main/resources/application-local.yml
index 19c4e4bae..ede2a171f 100644
--- a/stream-compositions/services/product-catalog-composition-service/src/main/resources/application-local.yml
+++ b/stream-compositions/services/product-catalog-composition-service/src/main/resources/application-local.yml
@@ -16,6 +16,10 @@ backbase:
arrangement:
manager:
direct-uri: http://localhost:8050
+ stream:
+ product-catalog:
+ integration:
+ direct-uri: http://localhost:7002
http:
client-secret: bb-secret
client-id: bb-client
@@ -25,7 +29,6 @@ backbase:
product-catalog:
enable-completed-events: false
enable-failed-events: false
- product-catalog-integration-url: http://localhost:7002
backbase.activemq.enabled: true
spring.activemq.broker-url: tcp://localhost:61616
diff --git a/stream-compositions/services/product-catalog-composition-service/src/main/resources/application.yml b/stream-compositions/services/product-catalog-composition-service/src/main/resources/application.yml
index be7db77da..9e9f3401e 100644
--- a/stream-compositions/services/product-catalog-composition-service/src/main/resources/application.yml
+++ b/stream-compositions/services/product-catalog-composition-service/src/main/resources/application.yml
@@ -26,7 +26,6 @@ backbase:
product-catalog:
enable-completed-events: false
enable-failed-events: true
- product-catalog-integration-url: http://product-catalog-ingestion-integration:8080
bootstrap:
enabled: false
diff --git a/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationTest.java b/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationTest.java
deleted file mode 100644
index 85e7a5614..000000000
--- a/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/core/config/ProductCatalogConfigurationTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.backbase.stream.compositions.productcatalog.core.config;
-
-import com.backbase.stream.compositions.integration.productcatalog.ApiClient;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.mockito.ArgumentMatchers.any;
-
-@ExtendWith(MockitoExtension.class)
-class ProductCatalogConfigurationTest {
- @Mock
- ApiClient apiClient;
-
- @Test
- void test() {
- ProductCatalogConfigurationProperties properties = new ProductCatalogConfigurationProperties();
- properties.setProductCatalogIntegrationUrl("http://product-catalog");
-
- ProductCatalogConfiguration configuration = new ProductCatalogConfiguration(properties);
- assertNotNull(configuration.productCatalogIntegrationApi(apiClient));
-
- ApiClient apiClient = configuration.productCatalogClient(
- WebClient.builder().build(), new ObjectMapper(), DateFormat.getDateInstance());
- assertEquals("http://product-catalog", apiClient.getBasePath());
- }
-}
diff --git a/stream-compositions/services/product-catalog-composition-service/src/test/resources/application.yml b/stream-compositions/services/product-catalog-composition-service/src/test/resources/application.yml
index 86524f463..b4babbfa4 100644
--- a/stream-compositions/services/product-catalog-composition-service/src/test/resources/application.yml
+++ b/stream-compositions/services/product-catalog-composition-service/src/test/resources/application.yml
@@ -7,7 +7,9 @@ spring:
enabled: false
enabled: false
discovery:
- enabled: true
+ enabled: false
+ loadbalancer:
+ enabled: false
activemq:
broker-url: vm://activemq
main:
@@ -35,6 +37,10 @@ backbase:
identity:
integration:
service-port: 8080
+ stream:
+ product-catalog:
+ integration:
+ direct-uri: http://localhost:18000
http:
client-secret: bb-secret
client-id: bb-client
@@ -55,7 +61,6 @@ backbase:
product-catalog:
enable-completed-events: false
enable-failed-events: true
- productCatalogIntegrationUrl: http://localhost:18000
bootstrap:
enabled: false
diff --git a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/PaymentCompositionClientConfiguration.java b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/PaymentCompositionClientConfiguration.java
new file mode 100644
index 000000000..98574ad5a
--- /dev/null
+++ b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/PaymentCompositionClientConfiguration.java
@@ -0,0 +1,35 @@
+package com.backbase.stream.compositions.product.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.paymentorder.ApiClient;
+import com.backbase.stream.compositions.paymentorder.client.PaymentOrderCompositionApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.payment-order.composition")
+public class PaymentCompositionClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "payment-order-composition";
+
+ public PaymentCompositionClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient paymentOrderApiClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public PaymentOrderCompositionApi paymentOrderCompositionApi(ApiClient paymentOrderApiClient) {
+ return new PaymentOrderCompositionApi(paymentOrderApiClient);
+ }
+
+}
diff --git a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductCompositionConfiguration.java b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductCompositionConfiguration.java
index 4c10f41b8..2ef9b5c62 100644
--- a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductCompositionConfiguration.java
+++ b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductCompositionConfiguration.java
@@ -1,95 +1,22 @@
package com.backbase.stream.compositions.product.core.config;
-import com.backbase.buildingblocks.webclient.WebClientConstants;
-import com.backbase.stream.compositions.integration.product.ApiClient;
-import com.backbase.stream.compositions.integration.product.api.ArrangementIntegrationApi;
-import com.backbase.stream.compositions.integration.product.api.ProductIntegrationApi;
-import com.backbase.stream.compositions.paymentorder.client.PaymentOrderCompositionApi;
-import com.backbase.stream.compositions.transaction.client.TransactionCompositionApi;
-import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
@Configuration
@AllArgsConstructor
@EnableConfigurationProperties(ProductConfigurationProperties.class)
public class ProductCompositionConfiguration {
- private final ProductConfigurationProperties productConfigurationProperties;
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
return http
- .csrf().disable()
- .build();
- }
-
- @Bean
- @Primary
- public ProductIntegrationApi productIntegrationApi(ApiClient productClient) {
- return new ProductIntegrationApi(productClient);
- }
-
- @Bean
- @Primary
- public ArrangementIntegrationApi arrangementIntegrationApi(ApiClient productClient) {
- return new ArrangementIntegrationApi(productClient);
- }
-
- @Bean
- @Primary
- public TransactionCompositionApi transactionCompositionApi(
- com.backbase.stream.compositions.transaction.ApiClient transactionClient) {
- return new TransactionCompositionApi(transactionClient);
- }
-
- @Bean
- @Primary
- public PaymentOrderCompositionApi paymentOrderCompositionApi(
- com.backbase.stream.compositions.paymentorder.ApiClient paymentOrderApiClient) {
- return new PaymentOrderCompositionApi(paymentOrderApiClient);
- }
-
- @Bean
- public com.backbase.stream.compositions.transaction.ApiClient transactionClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- com.backbase.stream.compositions.transaction.ApiClient apiClient =
- new com.backbase.stream.compositions.transaction.ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(productConfigurationProperties.getChains().getTransactionComposition().getBaseUrl());
-
- return apiClient;
- }
-
- @Bean
- public com.backbase.stream.compositions.paymentorder.ApiClient paymentOrderApiClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- com.backbase.stream.compositions.paymentorder.ApiClient apiClient =
- new com.backbase.stream.compositions.paymentorder.ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(productConfigurationProperties.getChains().getPaymentOrderComposition().getBaseUrl());
-
- return apiClient;
+ .csrf().disable()
+ .build();
}
- @Bean
- public ApiClient productClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- ApiClient apiClient = new ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(productConfigurationProperties.getIntegrationBaseUrl());
-
- return apiClient;
- }
}
diff --git a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductConfigurationProperties.java b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductConfigurationProperties.java
index 30bf30cfb..b39125cac 100644
--- a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductConfigurationProperties.java
+++ b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductConfigurationProperties.java
@@ -2,19 +2,22 @@
import com.backbase.stream.compositions.product.core.model.RequestConfig;
import com.backbase.stream.product.task.BatchProductIngestionMode;
-import lombok.*;
-import lombok.experimental.SuperBuilder;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
import java.util.ArrayList;
import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.experimental.SuperBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
@Setter
@Getter
@NoArgsConstructor
@ConfigurationProperties("backbase.stream.compositions.product")
public class ProductConfigurationProperties {
- private String integrationBaseUrl = "http://product-ingestion-integration:8080";
private Chains chains;
private Events events;
private Cursor cursor;
@@ -67,7 +70,6 @@ public static class Events {
@NoArgsConstructor
public static class Cursor {
private Boolean enabled = Boolean.FALSE;
- private String baseUrl = "http://product-cursor:9000";
}
@Data
@@ -93,7 +95,6 @@ public static class IngestionMode {
@AllArgsConstructor
public static abstract class BaseComposition {
private Boolean enabled = Boolean.FALSE;
- private String baseUrl = "http://localhost:9003/";
private Boolean async = Boolean.FALSE;
}
diff --git a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductIntegrationClientConfiguration.java b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductIntegrationClientConfiguration.java
new file mode 100644
index 000000000..cc7ce465e
--- /dev/null
+++ b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/ProductIntegrationClientConfiguration.java
@@ -0,0 +1,42 @@
+package com.backbase.stream.compositions.product.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.integration.product.ApiClient;
+import com.backbase.stream.compositions.integration.product.api.ArrangementIntegrationApi;
+import com.backbase.stream.compositions.integration.product.api.ProductIntegrationApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.product.integration")
+public class ProductIntegrationClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "product-integration";
+
+ public ProductIntegrationClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient productClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public ProductIntegrationApi productIntegrationApi(ApiClient productClient) {
+ return new ProductIntegrationApi(productClient);
+ }
+
+ @Bean
+ @Primary
+ public ArrangementIntegrationApi arrangementIntegrationApi(ApiClient productClient) {
+ return new ArrangementIntegrationApi(productClient);
+ }
+
+}
diff --git a/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/TransactionCompositionClientConfiguration.java b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/TransactionCompositionClientConfiguration.java
new file mode 100644
index 000000000..2130d5850
--- /dev/null
+++ b/stream-compositions/services/product-composition-service/src/main/java/com/backbase/stream/compositions/product/core/config/TransactionCompositionClientConfiguration.java
@@ -0,0 +1,35 @@
+package com.backbase.stream.compositions.product.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.transaction.ApiClient;
+import com.backbase.stream.compositions.transaction.client.TransactionCompositionApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.transaction.composition")
+public class TransactionCompositionClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "transaction-composition";
+
+ public TransactionCompositionClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient transactionClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public TransactionCompositionApi transactionCompositionApi(ApiClient transactionClient) {
+ return new TransactionCompositionApi(transactionClient);
+ }
+
+}
diff --git a/stream-compositions/services/product-composition-service/src/main/resources/application-local.yml b/stream-compositions/services/product-composition-service/src/main/resources/application-local.yml
index 6c981ec0b..5ebe55072 100644
--- a/stream-compositions/services/product-composition-service/src/main/resources/application-local.yml
+++ b/stream-compositions/services/product-composition-service/src/main/resources/application-local.yml
@@ -32,6 +32,16 @@ backbase:
arrangement:
manager:
direct-uri: http://localhost:8050
+ stream:
+ product:
+ integration:
+ direct-uri: http://localhost:7003
+ transaction:
+ composition:
+ direct-uri: http://localhost:9004
+ payment-order:
+ composition:
+ direct-uri: http://localhost:9004
http:
client-secret: bb-secret
client-id: bb-client
@@ -39,16 +49,13 @@ backbase:
stream:
compositions:
product:
- integration-base-url: http://localhost:7003
chains:
transaction-composition:
enabled: false
- base-url: http://localhost:9004
async: false
excludeProductTypeExternalIds:
payment-order-composition:
enabled: false
- base-url: http://localhost:9004
async: false
excludeProductTypeExternalIds:
events:
@@ -56,7 +63,6 @@ backbase:
enableFailed: true
cursor:
enabled: false
- base-url: http://localhost:9005
logging:
level:
diff --git a/stream-compositions/services/product-composition-service/src/main/resources/application.yml b/stream-compositions/services/product-composition-service/src/main/resources/application.yml
index a199aab95..bde5d773d 100644
--- a/stream-compositions/services/product-composition-service/src/main/resources/application.yml
+++ b/stream-compositions/services/product-composition-service/src/main/resources/application.yml
@@ -27,16 +27,13 @@ backbase:
stream:
compositions:
product:
- integration-base-url: http://product-integration:8080
chains:
transaction-composition:
enabled: true
- base-url: http://transaction-composition:8080
async: false
excludeProductTypeExternalIds:
payment-order-composition:
enabled: true
- base-url: http://payment-order-composition:8080
async: false
excludeProductTypeExternalIds:
events:
@@ -44,7 +41,6 @@ backbase:
enableFailed: true
cursor:
enabled: false
- base-url: http://product-cursor:8080
ingestion-mode:
function-groups: UPSERT
data-groups: UPSERT
diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/config/ProductConfigurationPropertiesTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/config/ProductConfigurationPropertiesTest.java
index d1440adb8..c328d238b 100644
--- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/config/ProductConfigurationPropertiesTest.java
+++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/config/ProductConfigurationPropertiesTest.java
@@ -6,11 +6,9 @@
import com.backbase.stream.compositions.product.core.config.ProductConfigurationProperties.Chains;
import com.backbase.stream.compositions.product.core.config.ProductConfigurationProperties.Cursor;
import com.backbase.stream.compositions.product.core.config.ProductConfigurationProperties.Events;
-import com.backbase.stream.compositions.product.core.config.ProductConfigurationProperties.TransactionComposition;
import com.backbase.stream.compositions.product.core.config.ProductConfigurationProperties.PaymentOrderComposition;
-
+import com.backbase.stream.compositions.product.core.config.ProductConfigurationProperties.TransactionComposition;
import java.util.List;
-
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
@@ -22,19 +20,16 @@ class ProductConfigurationPropertiesTest {
@Test
void testConfigurationProperties() {
ProductConfigurationProperties properties = new ProductConfigurationProperties();
- properties.setIntegrationBaseUrl("https://product");
Chains chains = new Chains();
TransactionComposition transactionComposition = new TransactionComposition();
transactionComposition.setEnabled(Boolean.TRUE);
- transactionComposition.setBaseUrl("https://transaction-composition");
transactionComposition.setAsync(Boolean.TRUE);
transactionComposition.setExcludeProductTypeExternalIds(List.of());
chains.setTransactionComposition(transactionComposition);
PaymentOrderComposition paymentOrderComposition = new PaymentOrderComposition();
paymentOrderComposition.setEnabled(Boolean.TRUE);
- paymentOrderComposition.setBaseUrl("https://payment-order-composition");
paymentOrderComposition.setAsync(Boolean.TRUE);
paymentOrderComposition.setExcludeProductTypeExternalIds(List.of());
chains.setPaymentOrderComposition(paymentOrderComposition);
@@ -44,27 +39,15 @@ void testConfigurationProperties() {
events.setEnableFailed(Boolean.TRUE);
Cursor cursor = new Cursor();
- cursor.setBaseUrl("https://cursor");
cursor.setEnabled(Boolean.TRUE);
properties.setChains(chains);
properties.setEvents(events);
properties.setCursor(cursor);
- assertTrue(properties.getIntegrationBaseUrl().contains("product"),
- "Correct config spotted");
- assertTrue(
- properties.getChains().getTransactionComposition().getBaseUrl()
- .contains("transaction-composition"),
- "Correct config spotted");
- assertTrue(
- properties.getChains().getPaymentOrderComposition().getBaseUrl()
- .contains("payment-order-composition"),
- "Correct config spotted");
assertTrue(properties.getEvents().getEnableCompleted());
assertTrue(properties.getEvents().getEnableFailed());
assertTrue(properties.getCursor().getEnabled());
- assertTrue(properties.getCursor().getBaseUrl().contains("cursor"), "Correct config spotted");
assertTrue(properties.isCompletedEventEnabled());
assertTrue(properties.isFailedEventEnabled());
assertTrue(properties.isTransactionChainEnabled());
@@ -72,4 +55,4 @@ void testConfigurationProperties() {
assertTrue(properties.isPaymentOrderChainEnabled());
assertTrue(properties.isPaymentOrderChainAsync());
}
-}
\ No newline at end of file
+}
diff --git a/stream-compositions/services/product-composition-service/src/test/resources/application.yml b/stream-compositions/services/product-composition-service/src/test/resources/application.yml
index a61c5e089..f891361c5 100644
--- a/stream-compositions/services/product-composition-service/src/test/resources/application.yml
+++ b/stream-compositions/services/product-composition-service/src/test/resources/application.yml
@@ -5,6 +5,9 @@ spring:
enabled: false
main:
allow-bean-definition-overriding: true
+ cloud:
+ loadbalancer:
+ enabled: false
sso:
jwt:
internal:
@@ -28,6 +31,16 @@ backbase:
arrangement:
manager:
direct-uri: http://localhost:8082/arrangement-manager
+ stream:
+ product:
+ integration:
+ direct-uri: http://localhost:18000
+ transaction:
+ composition:
+ direct-uri: http://localhost:12000
+ payment-order:
+ composition:
+ direct-uri: http://localhost:13000
http:
client-secret: bb-secret
client-id: bb-client
@@ -40,16 +53,13 @@ backbase:
stream:
compositions:
product:
- integration-base-url: http://localhost:18000
chains:
transaction-composition:
enabled: true
- base-url: http://localhost:12000
async: false
excludeProductTypeExternalIds:
payment-order-composition:
enabled: true
- base-url: http://localhost:13000
async: false
excludeProductTypeExternalIds:
events:
@@ -57,7 +67,6 @@ backbase:
enableFailed: true
cursor:
enabled: false
- base-url: http://localhost:9999
logging:
level:
diff --git a/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfiguration.java b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfiguration.java
index f0079c220..f3e9ed3ee 100644
--- a/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfiguration.java
+++ b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfiguration.java
@@ -1,66 +1,19 @@
package com.backbase.stream.compositions.transaction.core.config;
-import com.backbase.buildingblocks.webclient.WebClientConstants;
-import com.backbase.stream.compositions.transaction.cursor.client.TransactionCursorApi;
-import com.backbase.stream.compositions.transaction.integration.ApiClient;
-import com.backbase.stream.compositions.transaction.integration.client.TransactionIntegrationApi;
-import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
@Configuration
@AllArgsConstructor
@EnableConfigurationProperties(TransactionConfigurationProperties.class)
public class TransactionCompositionConfiguration {
- private final TransactionConfigurationProperties transactionConfigurationProperties;
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
return http.csrf().disable().build();
}
-
- @Bean
- @Primary
- public TransactionIntegrationApi transactionIntegrationApi(ApiClient transactionIntegrationClient) {
- return new TransactionIntegrationApi(transactionIntegrationClient);
- }
-
- @Bean
- @Primary
- public TransactionCursorApi transactionCursorApi(
- com.backbase.stream.compositions.transaction.cursor.ApiClient transactionCursorClient) {
- return new TransactionCursorApi(transactionCursorClient);
- }
-
- @Bean
- public ApiClient transactionIntegrationClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- ApiClient apiClient = new ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(transactionConfigurationProperties.getIntegrationBaseUrl());
-
- return apiClient;
- }
-
- @Bean
- public com.backbase.stream.compositions.transaction.cursor.ApiClient transactionCursorClient(
- @Qualifier(WebClientConstants.INTER_SERVICE_WEB_CLIENT_NAME) WebClient dbsWebClient,
- ObjectMapper objectMapper,
- DateFormat dateFormat) {
- com.backbase.stream.compositions.transaction.cursor.ApiClient apiClient =
- new com.backbase.stream.compositions.transaction.cursor.ApiClient(dbsWebClient, objectMapper, dateFormat);
- apiClient.setBasePath(transactionConfigurationProperties.getCursor().getBaseUrl());
-
- return apiClient;
- }
}
diff --git a/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationProperties.java b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationProperties.java
index 5fee12d2f..fb591fd57 100644
--- a/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationProperties.java
+++ b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationProperties.java
@@ -11,7 +11,6 @@
@NoArgsConstructor
@ConfigurationProperties("backbase.stream.compositions.transaction")
public class TransactionConfigurationProperties {
- private String integrationBaseUrl = "http://transaction-ingestion-integration:8080";
private Events events;
private Cursor cursor;
private Integer defaultStartOffsetInDays;
@@ -28,7 +27,6 @@ public static class Events {
public static class Cursor {
private Boolean enabled = Boolean.FALSE;
private Boolean transactionIdsFilterEnabled = Boolean.FALSE;
- private String baseUrl = "http://product-cursor:9000";
}
public final boolean isCursorEnabled() {
diff --git a/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCursorClientConfiguration.java b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCursorClientConfiguration.java
new file mode 100644
index 000000000..f88b41dad
--- /dev/null
+++ b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionCursorClientConfiguration.java
@@ -0,0 +1,35 @@
+package com.backbase.stream.compositions.transaction.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.transaction.cursor.ApiClient;
+import com.backbase.stream.compositions.transaction.cursor.client.TransactionCursorApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.transaction.cursor")
+public class TransactionCursorClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "transaction-cursor";
+
+ public TransactionCursorClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient transactionCursorClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public TransactionCursorApi transactionCursorApi(ApiClient transactionCursorClient) {
+ return new TransactionCursorApi(transactionCursorClient);
+ }
+
+}
diff --git a/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionIntegrationClientConfiguration.java b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionIntegrationClientConfiguration.java
new file mode 100644
index 000000000..c4c896529
--- /dev/null
+++ b/stream-compositions/services/transaction-composition-service/src/main/java/com/backbase/stream/compositions/transaction/core/config/TransactionIntegrationClientConfiguration.java
@@ -0,0 +1,35 @@
+package com.backbase.stream.compositions.transaction.core.config;
+
+import com.backbase.stream.clients.config.CompositeApiClientConfig;
+import com.backbase.stream.compositions.transaction.integration.ApiClient;
+import com.backbase.stream.compositions.transaction.integration.client.TransactionIntegrationApi;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.text.DateFormat;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@ConfigurationProperties("backbase.communication.services.stream.transaction.integration")
+public class TransactionIntegrationClientConfiguration extends CompositeApiClientConfig {
+
+ public static final String SERVICE_ID = "transaction-integration";
+
+ public TransactionIntegrationClientConfiguration() {
+ super(SERVICE_ID);
+ }
+
+ @Bean
+ public ApiClient transactionIntegrationClient(ObjectMapper objectMapper, DateFormat dateFormat) {
+ return new ApiClient(getWebClient(), objectMapper, dateFormat)
+ .setBasePath(createBasePath());
+ }
+
+ @Bean
+ @Primary
+ public TransactionIntegrationApi transactionIntegrationApi(ApiClient transactionIntegrationClient) {
+ return new TransactionIntegrationApi(transactionIntegrationClient);
+ }
+
+}
diff --git a/stream-compositions/services/transaction-composition-service/src/main/resources/application-local.yml b/stream-compositions/services/transaction-composition-service/src/main/resources/application-local.yml
index 51333fdd5..a752d7f7d 100644
--- a/stream-compositions/services/transaction-composition-service/src/main/resources/application-local.yml
+++ b/stream-compositions/services/transaction-composition-service/src/main/resources/application-local.yml
@@ -32,6 +32,12 @@ backbase:
transaction:
manager:
direct-uri: http://localhost:8083
+ stream:
+ transaction:
+ cursor:
+ direct-uri: http://localhost:9005
+ integration:
+ direct-uri: http://localhost:7004
http:
client-secret: bb-secret
client-id: bb-client
@@ -42,14 +48,12 @@ backbase:
compositions:
transaction:
defaultStartOffsetInDays: 30
- integration-base-url: http://localhost:7004
events:
enableCompleted: true
enableFailed: true
cursor:
enabled: true
transactionIdsFilterEnabled: true
- base-url: http://localhost:9005
eureka:
instance:
diff --git a/stream-compositions/services/transaction-composition-service/src/main/resources/application.yml b/stream-compositions/services/transaction-composition-service/src/main/resources/application.yml
index 498736d4d..b07232cd1 100644
--- a/stream-compositions/services/transaction-composition-service/src/main/resources/application.yml
+++ b/stream-compositions/services/transaction-composition-service/src/main/resources/application.yml
@@ -34,11 +34,9 @@ backbase:
compositions:
transaction:
defaultStartOffsetInDays: 30
- integration-base-url: http://transaction-integration:8080
events:
enableCompleted: true
enableFailed: true
cursor:
enabled: true
transactionIdsFilterEnabled: false
- base-url: http://transaction-cursor:8080
diff --git a/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfigurationTest.java b/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfigurationTest.java
deleted file mode 100644
index 7f3285bac..000000000
--- a/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionCompositionConfigurationTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.backbase.stream.compositions.transaction.core.config;
-
-import com.backbase.stream.compositions.transaction.cursor.client.TransactionCursorApi;
-import com.backbase.stream.compositions.transaction.integration.ApiClient;
-import com.backbase.stream.compositions.transaction.integration.client.TransactionIntegrationApi;
-import com.backbase.stream.compositions.transaction.core.config.TransactionCompositionConfiguration;
-import com.backbase.stream.compositions.transaction.core.config.TransactionConfigurationProperties;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import java.text.DateFormat;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-@ExtendWith(MockitoExtension.class)
-class TransactionCompositionConfigurationTest {
-
- @Mock
- private WebClient webClient;
-
- @Mock
- private ObjectMapper objectMapper;
-
- @Mock
- private DateFormat dateFormat;
-
- @Mock
- private TransactionConfigurationProperties properties;
-
- private ApiClient transactionIntegrationClient;
-
- private com.backbase.stream.compositions.transaction.cursor.ApiClient transactionCursorClient;
-
- private TransactionCursorApi transactionCursorApi;
-
- private TransactionIntegrationApi transactionIntegrationApi;
-
- @BeforeEach
- void init() {
- TransactionConfigurationProperties.Cursor cursorConfig = new TransactionConfigurationProperties.Cursor();
- cursorConfig.setBaseUrl("https://transaction-cursor");
-
- Mockito.when(properties.getIntegrationBaseUrl()).thenReturn("https://transaction-integration");
- Mockito.when(properties.getCursor()).thenReturn(cursorConfig);
-
- transactionCursorClient = new com.backbase.stream.compositions.transaction.cursor.ApiClient
- (webClient, objectMapper, dateFormat);
- transactionCursorClient.setBasePath(properties.getCursor().getBaseUrl());
-
- transactionIntegrationClient = new ApiClient(webClient, objectMapper, dateFormat);
- transactionIntegrationClient.setBasePath(properties.getIntegrationBaseUrl());
-
- transactionCursorApi = new TransactionCursorApi(transactionCursorClient);
- transactionIntegrationApi = new TransactionIntegrationApi(transactionIntegrationClient);
-
- }
-
- @Test
- void testCompositionConfig() {
- TransactionCompositionConfiguration config = new TransactionCompositionConfiguration(properties);
-
- //Mockito.when(config.transactionIntegrationApi(any())).thenReturn(transactionIntegrationApi);
- //Mockito.when(config.transactionCursorApi(any())).thenReturn(transactionCursorApi);
-
- assertNotNull(config.transactionIntegrationApi(transactionIntegrationClient));
- assertNotNull(config.transactionIntegrationApi(transactionIntegrationClient).getApiClient());
- assertNotNull(config.transactionIntegrationApi(transactionIntegrationClient).getApiClient().getBasePath());
- assertEquals("https://transaction-integration",
- config.transactionIntegrationApi(transactionIntegrationClient).getApiClient().getBasePath());
-
- assertNotNull(config.transactionCursorApi(transactionCursorClient));
- assertNotNull(config.transactionCursorApi(transactionCursorClient).getApiClient());
- assertNotNull(config.transactionCursorApi(transactionCursorClient).getApiClient().getBasePath());
- assertEquals("https://transaction-cursor",
- config.transactionCursorApi(transactionCursorClient).getApiClient().getBasePath());
- }
-}
diff --git a/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationPropertiesTest.java b/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationPropertiesTest.java
index 4371c8d02..93f27315b 100644
--- a/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationPropertiesTest.java
+++ b/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/config/TransactionConfigurationPropertiesTest.java
@@ -1,21 +1,21 @@
package com.backbase.stream.compositions.transaction.core.config;
-import com.backbase.stream.compositions.transaction.core.config.TransactionConfigurationProperties;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import com.backbase.stream.compositions.transaction.core.config.TransactionConfigurationProperties.Cursor;
import com.backbase.stream.compositions.transaction.core.config.TransactionConfigurationProperties.Events;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
-import static org.junit.jupiter.api.Assertions.*;
-
@ExtendWith(MockitoExtension.class)
class TransactionConfigurationPropertiesTest {
@Test
void testConfig() {
TransactionConfigurationProperties properties = new TransactionConfigurationProperties();
- properties.setIntegrationBaseUrl("https://transaction");
properties.setDefaultStartOffsetInDays(30);
Events events = new Events();
@@ -23,21 +23,17 @@ void testConfig() {
events.setEnableFailed(Boolean.TRUE);
Cursor cursor = new Cursor();
- cursor.setBaseUrl("https://transaction-cursor");
cursor.setTransactionIdsFilterEnabled(Boolean.FALSE);
cursor.setEnabled(Boolean.TRUE);
properties.setEvents(events);
properties.setCursor(cursor);
- assertTrue(properties.getIntegrationBaseUrl().contains("transaction"),
- "Correct config spotted");
assertEquals(30, properties.getDefaultStartOffsetInDays());
assertTrue(properties.getEvents().getEnableCompleted());
assertTrue(properties.getEvents().getEnableFailed());
assertTrue(properties.getCursor().getEnabled());
assertFalse(properties.getCursor().getTransactionIdsFilterEnabled());
- assertTrue(properties.getCursor().getBaseUrl().contains("transaction-cursor"), "Correct config spotted");
assertTrue(properties.isCursorEnabled());
assertFalse(properties.isTransactionIdsFilterEnabled());
}
diff --git a/stream-compositions/services/transaction-composition-service/src/test/resources/application.yml b/stream-compositions/services/transaction-composition-service/src/test/resources/application.yml
index 05e13121d..90bee84b3 100644
--- a/stream-compositions/services/transaction-composition-service/src/test/resources/application.yml
+++ b/stream-compositions/services/transaction-composition-service/src/test/resources/application.yml
@@ -7,7 +7,9 @@ spring:
enabled: false
enabled: false
discovery:
- enabled: true
+ enabled: false
+ loadbalancer:
+ enabled: false
activemq:
broker-url: vm://activemq
main:
@@ -35,6 +37,12 @@ backbase:
transaction:
manager:
direct-uri: http://localhost:8083/transaction-manager
+ stream:
+ transaction:
+ integration:
+ direct-uri: http://localhost:18000
+ cursor:
+ direct-uri: http://localhost:12000
http:
client-secret: bb-secret
client-id: bb-client
@@ -51,14 +59,12 @@ backbase:
compositions:
transaction:
defaultStartOffsetInDays: 30
- integration-base-url: http://localhost:18000
events:
enableCompleted: true
enableFailed: true
cursor:
enabled: true
transactionIdsFilterEnabled: false
- base-url: http://localhost:12000
logging:
level:
diff --git a/stream-dbs-clients/src/main/java/com/backbase/stream/clients/config/CompositeApiClientConfig.java b/stream-dbs-clients/src/main/java/com/backbase/stream/clients/config/CompositeApiClientConfig.java
index 648cc9f53..387e120be 100644
--- a/stream-dbs-clients/src/main/java/com/backbase/stream/clients/config/CompositeApiClientConfig.java
+++ b/stream-dbs-clients/src/main/java/com/backbase/stream/clients/config/CompositeApiClientConfig.java
@@ -16,7 +16,7 @@
* false in services with support to client-side load balancing.
*/
@Validated
-class CompositeApiClientConfig extends ApiClientConfig {
+public class CompositeApiClientConfig extends ApiClientConfig {
/**
* Direct uri used as base path when load balancing is not available.
diff --git a/stream-legal-entity/legal-entity-bootstrap-task/pom.xml b/stream-legal-entity/legal-entity-bootstrap-task/pom.xml
index 2dfa760fc..172a125b3 100644
--- a/stream-legal-entity/legal-entity-bootstrap-task/pom.xml
+++ b/stream-legal-entity/legal-entity-bootstrap-task/pom.xml
@@ -15,7 +15,7 @@
Stream :: Legal Entity Bootstrap Task
- 2.33.2
+ 2.35.1
true
diff --git a/stream-legal-entity/legal-entity-http/pom.xml b/stream-legal-entity/legal-entity-http/pom.xml
index 7a6c51ed4..aeba177fc 100644
--- a/stream-legal-entity/legal-entity-http/pom.xml
+++ b/stream-legal-entity/legal-entity-http/pom.xml
@@ -17,7 +17,7 @@
${project.basedir}/../../api/stream-legal-entity/openapi.yaml
${project.build.directory}/api/openapi.yaml
- 2.33.2
+ 2.35.1
true
diff --git a/stream-portfolio/portfolio-http/pom.xml b/stream-portfolio/portfolio-http/pom.xml
index 2d33546b3..e63b5fb73 100644
--- a/stream-portfolio/portfolio-http/pom.xml
+++ b/stream-portfolio/portfolio-http/pom.xml
@@ -21,7 +21,7 @@
true
- 2.33.2
+ 2.35.1
diff --git a/stream-product-catalog/product-catalog-task/pom.xml b/stream-product-catalog/product-catalog-task/pom.xml
index 438aacfc0..18df6f8cb 100644
--- a/stream-product-catalog/product-catalog-task/pom.xml
+++ b/stream-product-catalog/product-catalog-task/pom.xml
@@ -16,7 +16,7 @@
true
- 2.33.2
+ 2.35.1
diff --git a/stream-sdk/stream-parent/pom.xml b/stream-sdk/stream-parent/pom.xml
index 85275e7a6..e816135d8 100644
--- a/stream-sdk/stream-parent/pom.xml
+++ b/stream-sdk/stream-parent/pom.xml
@@ -5,7 +5,7 @@
com.backbase.buildingblocks
backbase-parent
- 15.2.2
+ 15.2.3
@@ -36,7 +36,7 @@
- 15.2.2
+ 15.2.3
true
diff --git a/stream-sdk/stream-parent/stream-test-support/pom.xml b/stream-sdk/stream-parent/stream-test-support/pom.xml
index f457f2154..3f5b5f173 100644
--- a/stream-sdk/stream-parent/stream-test-support/pom.xml
+++ b/stream-sdk/stream-parent/stream-test-support/pom.xml
@@ -80,7 +80,7 @@
com.github.tomakehurst
wiremock-jre8
- 2.33.2
+ 2.35.1
diff --git a/stream-sdk/stream-starter-parents/stream-http-starter-parent/pom.xml b/stream-sdk/stream-starter-parents/stream-http-starter-parent/pom.xml
index ba6898f95..9c458e865 100644
--- a/stream-sdk/stream-starter-parents/stream-http-starter-parent/pom.xml
+++ b/stream-sdk/stream-starter-parents/stream-http-starter-parent/pom.xml
@@ -6,7 +6,7 @@
com.backbase.buildingblocks
service-sdk-starter-reactive
- 15.2.2
+ 15.2.3
diff --git a/stream-sdk/stream-starter-parents/stream-task-starter-parent/pom.xml b/stream-sdk/stream-starter-parents/stream-task-starter-parent/pom.xml
index 3a12d8c4e..d84b02588 100644
--- a/stream-sdk/stream-starter-parents/stream-task-starter-parent/pom.xml
+++ b/stream-sdk/stream-starter-parents/stream-task-starter-parent/pom.xml
@@ -5,7 +5,7 @@
com.backbase.buildingblocks
service-sdk-starter-reactive
- 15.2.2
+ 15.2.3