Revert "Migrate CPS to Spring-boot 3.0"
[cps.git] / cps-application / src / main / resources / application.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Pantheon.tech
3 #  Modifications Copyright (C) 2021-2022 Bell Canada
4 #  Modifications Copyright (C) 2021-2023 Nordix Foundation
5 #  ================================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #        http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #
18 #  SPDX-License-Identifier: Apache-2.0
19 #  ============LICENSE_END=========================================================
20
21 server:
22     port: 8080
23
24 rest:
25     api:
26         cps-base-path: /cps/api
27         ncmp-base-path: /ncmp
28         ncmp-inventory-base-path: /ncmpInventory
29
30 spring:
31     main:
32         banner-mode: "off"
33     application:
34         name: "cps-application"
35     jpa:
36         show-sql: false
37         ddl-auto: create
38         open-in-view: false
39         properties:
40             hibernate:
41                 enable_lazy_load_no_trans: true
42                 dialect: org.hibernate.dialect.PostgreSQLDialect
43
44     datasource:
45         url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/cpsdb
46         username: ${DB_USERNAME}
47         password: ${DB_PASSWORD}
48         driverClassName: org.postgresql.Driver
49         hikari:
50             minimumIdle: 5
51             maximumPoolSize: 80
52             idleTimeout: 60000
53             connectionTimeout: 120000
54             leakDetectionThreshold: 30000
55             pool-name: CpsDatabasePool
56
57     cache:
58         type: caffeine
59         cache-names: yangSchema
60         caffeine:
61             spec: maximumSize=10000,expireAfterAccess=10m
62
63     liquibase:
64         change-log: classpath:changelog/changelog-master.yaml
65         labels: ${LIQUIBASE_LABELS}
66
67     servlet:
68         multipart:
69             enabled: true
70             max-file-size: 100MB
71             max-request-size: 100MB
72
73     kafka:
74         bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER:localhost:9092}
75         security:
76             protocol: PLAINTEXT
77         producer:
78             value-serializer: io.cloudevents.kafka.CloudEventSerializer
79             client-id: cps-core
80         consumer:
81             group-id: ${NCMP_CONSUMER_GROUP_ID:ncmp-group}
82             key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
83             value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
84             properties:
85                 spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
86                 spring.deserializer.value.delegate.class: io.cloudevents.kafka.CloudEventDeserializer
87                 spring.json.use.type.headers: false
88
89     jackson:
90         default-property-inclusion: NON_NULL
91         serialization:
92             FAIL_ON_EMPTY_BEANS: false
93     sql:
94         init:
95             mode: ALWAYS
96 app:
97     ncmp:
98         async-m2m:
99             topic: ${NCMP_ASYNC_M2M_TOPIC:ncmp-async-m2m}
100         avc:
101             subscription-topic: ${NCMP_CM_AVC_SUBSCRIPTION:subscription}
102             subscription-forward-topic-prefix: ${NCMP_FORWARD_CM_AVC_SUBSCRIPTION:ncmp-dmi-cm-avc-subscription-}
103             subscription-response-topic: ${NCMP_RESPONSE_CM_AVC_SUBSCRIPTION:dmi-ncmp-cm-avc-subscription}
104             subscription-outcome-topic: ${NCMP_OUTCOME_CM_AVC_SUBSCRIPTION:subscription-response}
105             cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
106     lcm:
107         events:
108             topic: ${LCM_EVENTS_TOPIC:ncmp-events}
109     dmi:
110         cm-events:
111             topic: ${DMI_CM_EVENTS_TOPIC:dmi-cm-events}
112         device-heartbeat:
113             topic: ${DMI_DEVICE_HEARTBEAT_TOPIC:dmi-device-heartbeat}
114
115
116 notification:
117     enabled: true
118     data-updated:
119         topic: ${CPS_CHANGE_EVENT_TOPIC:cps.data-updated-events}
120         filters:
121             enabled-dataspaces: ${NOTIFICATION_DATASPACE_FILTER_PATTERNS:""}
122     async:
123         executor:
124             core-pool-size: 2
125             max-pool-size: 10
126             queue-capacity: 500
127             wait-for-tasks-to-complete-on-shutdown: true
128             thread-name-prefix: Async-
129             time-out-value-in-ms: 2000
130
131 springdoc:
132     swagger-ui:
133         disable-swagger-default-url: true
134         urlsPrimaryName: cps-core
135         urls:
136             - name: cps-core
137               url: /api-docs/cps-core/openapi.yaml
138             - name: cps-ncmp
139               url: /api-docs/cps-ncmp/openapi.yaml
140             - name: cps-ncmp-inventory
141               url: /api-docs/cps-ncmp/openapi-inventory.yaml
142
143
144 security:
145     # comma-separated uri patterns which do not require authorization
146     permit-uri: /manage/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/**
147     auth:
148         username: ${CPS_USERNAME}
149         password: ${CPS_PASSWORD}
150
151 # Actuator
152 management:
153     server:
154         port: 8081
155     endpoints:
156         web:
157             base-path: /manage
158             exposure:
159                 include: info,health,loggers,prometheus
160     endpoint:
161         health:
162             show-details: always
163             # kubernetes probes: liveness and readiness
164             probes:
165                 enabled: true
166
167 logging:
168     format: json
169     level:
170         org:
171             springframework: INFO
172             onap:
173                 cps: INFO
174 ncmp:
175     dmi:
176         auth:
177             username: ${DMI_USERNAME}
178             password: ${DMI_PASSWORD}
179             enabled: ${DMI_AUTH_ENABLED:true}
180         api:
181             base-path: dmi
182
183     timers:
184         advised-modules-sync:
185             sleep-time-ms: 5000
186         locked-modules-sync:
187             sleep-time-ms: 300000
188         cm-handle-data-sync:
189             sleep-time-ms: 30000
190         subscription-forwarding:
191             dmi-response-timeout-ms: 30000
192         model-loader:
193             retry-time-ms: 1000
194         trust-level:
195             dmi-availability-watchdog-ms: 30000
196
197     modules-sync-watchdog:
198         async-executor:
199             parallelism-level: 10
200
201     model-loader:
202         subscription: true
203         maximum-attempt-count: 20
204
205 # Custom Hazelcast Config.
206 hazelcast:
207     cluster-name: ${CPS_NCMP_CACHES_CLUSTER_NAME:"cps-and-ncmp-common-cache-cluster"}
208     mode:
209         kubernetes:
210             enabled: ${HAZELCAST_MODE_KUBERNETES_ENABLED:false}
211             service-name: ${CPS_NCMP_SERVICE_NAME:"cps-and-ncmp-service"}