Basket Finalization Service

Migration to v1.23.0

Service 2 Service Authentication

Add - new API path:

The "service 2 service" feature has been introduced in this version of the Basket Finalization Service. From now on, the Basket Finalization Service is only able to validate service tokens (client/operator tokens are no longer validated). The validation of all kinds of client/operator tokens now happens in the API gateway, therefore the new API path has been introduced (/api/basket-finalization) and must be used by all clients (Basket Authorization and Authentication).

Add - new base roles:

A new set of base roles has been introduced for the Basket Finalization Service. Every client calling the Basket Finalization Service needs the required base role for the called endpoint either in its service token or passport (if it is the first service in the call chain). The new base roles start with "b:basket.fin".

Remove - "tenantId" as a variable in the base path (url):

Resolving the "tenantId" out of the request URL of an incoming request has been removed by changing the security lib (AppKit to cloud platform). The tenantId must be provided by the caller via an http header (GK-Tenant-Id) or in the passport.

Section in the API Guideline: Using tenantId as a variable in the base path does not work well with the API gateway. Therefore, new service APIs must not use tenantId as a path. The tenantId must be taken from JWT (transformed by the API gateway into GK Passport) or the GK-Tenant-Id header.

Migration to v1.19.0

Configuration Changes

Old New Description
bfs:   
basketEvents:                           
topic: "{{ tpl .Values.global.environment.}}.basket.events"                           
basketFinalizationEvents:                            
topic: "{{ tpl .Values.global.environment.}}.basket.finalization.events" 
storeEvents:  
topic: "{{ tpl .Values.global.environment . }}.store.events"
kafka:
topicEnvs:
BFS_BASKETEVENTS_TOPIC: basket.events
BFS_BASKETFINALIZATIONEVENTS_TOPIC: basket.finalization.events
BFS_STOREEVENTS_TOPIC: store.events
Topic names can be changed for a specific cluster via:
Kafka: topicEnvs: BFS_STOREEVENTS_TOPIC: basket.store.events
                

Migration to v1.11.0

Configuration Changes

A lot of configurations have been moved from the Storemanager template to application.yaml (e.g. client-side 'Basic Auth' credentials are automatically set to cluster secret values and do not need to be configured in the SM template).

Removed application.yaml (New) Description
## Basket Service

gkr.basket-finalization-service.remote-client.basket.url

gkr.basket-finalization-service.remote-client.basket.connectTimeout

gkr.basket-finalization-service.remote-client.basket.readTimeout

core.common.security.client.http.auth.group.basket-service.type

core.common.security.client.http.auth.group.basket-service.BASIC.username

core.common.security.client.http.auth.group.basket-service.BASIC.password

bfs:                
remote-services:                     
basket-service:              
url: http://basket-service:8080/basket-service             
read-timeout: 31000         
connection-timeout: 30000                 
max-conn-per-route: 150           
max-conn-total: 150               
authentication:               
username: basket-finalization-service                 
password:             
No manual config change in the cluster needed. URLs are set to cloud-internal URLs and credentials are filled with values from cluster secrets.
## Gate Service

gkr.basket-finalization-service.remote-client.gate-service.url

gkr.basket-finalization-service.remote-client.gate-service.connectTimeout

gkr.basket-finalization-service.remote-client.gate-service.readTimeout

core.common.security.client.http.auth.group.gate-service.type

core.common.security.client.http.auth.group.gate-service.BASIC.username

core.common.security.client.http.auth.group.gate-service.BASIC.password

bfs:
remote-services:
gate-service:
url: http://basket-service:8080/basket-service
read-timeout: 31000
connection-timeout: 30000
max-conn-per-route: 150
max-conn-total: 150
authentication:
username: basket-finalization-service
password:
                
No manual config change in the cluster needed. URLs are set to cloud-internal URLs and credentials are filled with values from cluster secrets.
## POS Service

gkr.basket-finalization-service.remote-client.pos-service.url

gkr.basket-finalization-service.remote-client.pos-service.connectTimeout

gkr.basket-finalization-service.remote-client.pos-service.readTimeout

core.common.security.client.http.auth.group.pos-service.type

core.common.security.client.http.auth.group.pos-service.BASIC.username

core.common.security.client.http.auth.group.pos-service.BASIC.password

bfs:
remote-services:    
pos-service:                   
url: http://pos-service:8080/pos-service             
read-timeout: 31000
connection-timeout: 30000                          
max-conn-per-route: 150                            
max-conn-total: 150                           
authentication:                          
username: basket-finalization-service                           
password:             
No manual config change in the cluster needed. URLs are set to cloud-internal URLs and credentials are filled with values from cluster secrets.
## SDC

gkr.basket-finalization-service.remote-client.sdc.url

gkr.basket-finalization-service.remote-client.sdc.connectTimeout

gkr.basket-finalization-service.remote-client.sdc.readTimeout

core.common.security.client.http.auth.group.sdc.type

core.common.security.client.http.auth.group.sdc.BASIC.username

core.common.security.client.http.auth.group.sdc.BASIC.password

bfs:                  
remote-services:                         
sdc:                         
url: http://sdc:8080/sdc                      
read-timeout: 31000                         
connection-timeout: 30000                            
max-conn-per-route: 150                            
max-conn-total: 150                         
authentication:                           
username: basket-finalization-service                           
password:               
No manual config change in the cluster needed. URLs are set to cloud-internal URLs and credentials are filled with values from cluster secrets.
## Digital Receipt Service (eMailbon backend)

gkr.basket-finalization-service.remote-client.digital-receipt-service.url

gkr.basket-finalization-service.remote-client.digital-receipt-service.connectTimeout

gkr.basket-finalization-service.remote-client.digital-receipt-service.readTimeout

core.common.security.client.http.auth.group.digital-receipt-service.type

core.common.security.client.http.auth.group.digital-receipt-service.BASIC.username

core.common.security.client.http.auth.group.digital-receipt-service.BASIC.password

bfs:
remote-services:
digital-receipt-service:
url: ${eReceipts.services.url}
read-timeout: 31000
connection-timeout: 30000
max-conn-per-route: 150
max-conn-total: 150
authentication:
username:
password:
customEnvs:
- name: ERECEIPTS_SERVICES_URL
value: "{{ .Values.eReceipts.services.url }}"
- name: BFS_REMOTESERVICES_DIGITALRECEIPTSERVICE_AUTHENTICATION_USERNAME
value: "{{ .Values.eReceipts.username }}"
- name: BFS_REMOTESERVICES_DIGITALRECEIPTSERVICE_AUTHENTICATION_PASSWORD
value: "{{ .Values.eReceipts.password }}"
eReceipts:
username:
password:
services:
url:
URL, user and password must be set for the specific cluster

e.g:

eReceipts:
username: user
password: password
services:
url: https://gkproduct.e-receipts.io:443
## Transaction Pool

gkr.basket-finalization-service.remote-client.tx-pool.url

gkr.basket-finalization-service.remote-client.tx-pool.connectTimeout

gkr.basket-finalization-service.remote-client.tx-pool.readTimeout

core.common.security.client.http.auth.group.transaction-pool.type

core.common.security.client.http.auth.group.transaction-pool.BASIC.username

core.common.security.client.http.auth.group.transaction-pool.BASIC.password

bfs:
remote-services:
transaction-pool:
url: http://sdc:8080/sdc
read-timeout: 31000
connection-timeout: 30000
max-conn-per-route: 150
max-conn-total: 150
authentication:
username: basket-finalization-service
password:
No manual config change in the cluster needed. URLs are set to cloud-internal URLs and credentials are filled with values from cluster secrets.
# Caching

caching.cachingEnabled

caching.mbeansEnabled

caching.statisticsEnabled

# Cache BusinessUnit

caching.cache.BusinessUnit.expiration

caching.cache.BusinessUnit.capacity

bfs:
caching:
enabled: true
statistics-enabled: false
mbeans-enabled: false
caches:
BusinessUnit:
expiration: 4h
capacity: 10000
No manual config change in the cluster needed.
## Kafka spring.kafka.bootstrapServers spring.kafka.consumer.groupId spring.kafka.producer.clientId

spring.kafka.producer.acks

gkr.basket-finalization-service.kafka.enabled

# Prefix of Kafka topics for cases where multiple application instances share the same Kafka broker:

gkr.basket-finalization-service.kafka.topics.prefix=

# Kafka topic for store events

gkr.basket-finalization-service.kafka.topics.storeEventsTopic

# Kafka topic for basket events

gkr.basket-finalization-service.kafka.topics.basketEventsTopic

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.concurrency

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.initialRetryInterval

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.retryIntervalMultiplier

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.maxRetryInterval

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.maxRetriesNumber

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.maxPollRecords

gkr.basket-finalization-service.kafka.listeners.basketEventsListener.maxPollInterval

# Kafka topic for basket finalization events

gkr.basket-finalization-service.kafka.topics.basketFinalizationEventsTopic

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.concurrency

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.initialRetryInterval

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.retryIntervalMultiplier

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.maxRetryInterval

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.maxRetriesNumber

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.maxPollRecords

gkr.basket-finalization-service.kafka.listeners.finalizationEventsListener.maxPollInterval

# StoreDeviceEvents

gkr.basket-finalization-service.store-device-events.destination

gkr.basket-finalization-service.store-device-events.deviceGroup

gkr.basket-finalization-service.store-device-events.deviceType

spring:
kafka:
bootstrap-servers: kafka:9092
consumer:
group-id: BasketFinalizationService
auto-offset-reset: earliest
producer:
client-id: BasketFinalizationService
acks: -1
bfs:
kafka:
enabled: true
basket-events:
topic: basket.events
listener:
concurrency: 5
initial-retry-interval: 10000
retry-interval-multiplier: 2
max-retry-interval: 30000
max-poll-records: 500
max-poll-interval: 300000
basket-finalization-events:
topic: basket.finalization.events
listener:
concurrency: 5
initial-retry-interval: 10000
retry-interval-multiplier: 2
max-retry-interval: 120000
max-poll-records: 50
max-poll-interval: 300000
store-events:
topic: store.events
destination: store.events
device-group: defaultGroup
device-type: ssc-byod
bfs:
basketEvents:
topic: "{{ tpl .Values.global.environment . }}.basket.events"
basketFinalizationEvents:
topic: "{{ tpl .Values.global.environment . }}.basket.finalization.events"
storeEvents:
topic: "{{ tpl .Values.global.environment . }}.store.events"
kafka:
bootstrapServers: kafka:9092
topic:
basket.finalization.events:
env: BASKET_FINALIZATION_SERVICE_KAFKA_TOPIC_BASKET_FINALIZATION_EVENTS
partitions: 20
replicationFactor: 3
config:
min.insync.replicas: 2
retention.ms: "86400000"
basket.finalization.events-dlt:
env: BASKET_FINALIZATION_SERVICE_KAFKA_TOPIC_BASKET_FINALIZATION_EVENTS_DLT
partitions: 1
replicationFactor: 3
config:
min.insync.replicas: 2
retention.ms: "86400000"
Topic names can be changed for a specific cluster via:
bfs:
basketEvents:
 topic:
basketFinalizationEvents:
 topic:
storeEvents:
 topic:
log4j-logging.propeties (complete file)
logging:
level:
com.gk_software.gkr.basket.service: INFO
com.gksoftware.gkr.basket.engine: INFO
Log settings can now be changed to "env" variables via helm chart values.

Example: values.yaml

extraEnvs:
- name: LOGGING_LEVEL_COM_GKSOFTWARE_GKR_BASKET_SERVICE
value: DEBUG
- name: LOGGING_LEVEL_COM_GKSOFTWARE_GKR_BASKET_ENGINE
value: DEBUG