Merge "Add retry mechanism on Subscription loader"
[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: org.springframework.kafka.support.serializer.JsonSerializer
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: org.springframework.kafka.support.serializer.JsonDeserializer
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:cm-avc-subscription}
102             cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
103     lcm:
104         events:
105             topic: ${LCM_EVENTS_TOPIC:ncmp-events}
106     dmi:
107         cm-events:
108             topic: ${DMI_CM_EVENTS_TOPIC:dmi-cm-events}
109
110
111 notification:
112     enabled: true
113     data-updated:
114         topic: ${CPS_CHANGE_EVENT_TOPIC:cps.data-updated-events}
115         filters:
116             enabled-dataspaces: ${NOTIFICATION_DATASPACE_FILTER_PATTERNS:""}
117     async:
118         executor:
119             core-pool-size: 2
120             max-pool-size: 10
121             queue-capacity: 500
122             wait-for-tasks-to-complete-on-shutdown: true
123             thread-name-prefix: Async-
124             time-out-value-in-ms: 2000
125
126 springdoc:
127     swagger-ui:
128         disable-swagger-default-url: true
129         urlsPrimaryName: cps-core
130         urls:
131             - name: cps-core
132               url: /api-docs/cps-core/openapi.yaml
133             - name: cps-ncmp
134               url: /api-docs/cps-ncmp/openapi.yaml
135             - name: cps-ncmp-inventory
136               url: /api-docs/cps-ncmp/openapi-inventory.yaml
137
138
139 security:
140     # comma-separated uri patterns which do not require authorization
141     permit-uri: /manage/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/**
142     auth:
143         username: ${CPS_USERNAME}
144         password: ${CPS_PASSWORD}
145
146 # Actuator
147 management:
148     server:
149         port: 8081
150     endpoints:
151         web:
152             base-path: /manage
153             exposure:
154                 include: info,health,loggers,prometheus
155     endpoint:
156         health:
157             show-details: always
158             # kubernetes probes: liveness and readiness
159             probes:
160                 enabled: true
161
162 logging:
163     format: json
164     level:
165         org:
166             springframework: INFO
167             onap:
168                 cps: INFO
169 ncmp:
170     dmi:
171         auth:
172             username: ${DMI_USERNAME}
173             password: ${DMI_PASSWORD}
174         api:
175             base-path: dmi
176
177     timers:
178         advised-modules-sync:
179             sleep-time-ms: 5000
180         locked-modules-sync:
181             sleep-time-ms: 300000
182         cm-handle-data-sync:
183             sleep-time-ms: 30000
184
185     modules-sync-watchdog:
186         async-executor:
187             parallelism-level: 10
188
189     model-loader:
190         subscription: false
191         maximumAttemptCount: 20
192         retryTimeMs: 1000
193
194 # Custom Hazelcast Config.
195 hazelcast:
196   mode:
197     kubernetes:
198       enabled: ${HAZELCAST_MODE_KUBERNETES_ENABLED:false}
199       service-name: ${CPS_NCMP_SERVICE_NAME:"cps-and-ncmp-service"}