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