fix debug log
[dcaegen2/analytics/tca-gen2.git] / dcae-analytics / dcae-analytics-model / src / main / java / org / onap / dcae / analytics / model / DmaapMrConstants.java
1 /*
2  * ================================================================================
3  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=========================================================
17  *
18  */
19
20 package org.onap.dcae.analytics.model;
21
22 import java.util.Set;
23 import java.util.stream.Collectors;
24 import java.util.stream.Stream;
25
26 /**
27  * @author Rajiv Singla
28  */
29 public abstract class DmaapMrConstants {
30
31     // ================== DMaaP MR CONSTANTS ============================== //
32
33     // MR SUBSCRIBER
34     public static final String SUBSCRIBER_EMPTY_MESSAGE_RESPONSE_STRING = "[]";
35     public static final String SUBSCRIBER_RANDOM_CONSUMER_GROUP_PREFIX = "DCAE-SUB-";
36     public static final String SUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME = "timeout";
37     public static final Integer SUBSCRIBER_DEFAULT_TIMEOUT = -1;
38     public static final Integer SUBSCRIBER_DEFAULT_FIXED_POLLING_INTERVAL = 30_000;
39     public static final String SUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME = "limit";
40     public static final Integer SUBSCRIBER_DEFAULT_MESSAGE_LIMIT = 50_000;
41     public static final Integer SUBSCRIBER_DEFAULT_PROCESSING_BATCH_SIZE = 10_000;
42
43
44     // =================== INTEGRATION DEFAULTS =========================== //
45
46     // RETRY ON FAILURE
47     public static final Integer DEFAULT_NUM_OF_RETRIES_ON_FAILURE = 5;
48     public static final Integer DEFAULT_RETRY_INITIAL_INTERVAL = 1_000;
49     public static final Integer DEFAULT_RETRY_MULTIPLIER = 5;
50     public static final Integer DEFAULT_RETRY_MAX_INTERVAL = 300_000;
51
52     public static final String DMAAP_MR_SUBSCRIBER_OUTPUT_CHANNEL_NAME = "mrSubscriberOutputChannel";
53     public static final String DMAAP_MR_PUBLISHER_INPUT_CHANNEL = "mrPublisherInputChannel";
54     public static final String DMAAP_MR_PUBLISHER_OUTPUT_CHANNEL = "mrPublisherOutputChannel";
55
56     // MESSAGE STORE NAMES
57     public static final String DMAAP_MR_SUBSCRIBER_OUTPUT_MESSAGE_STORE_GROUP_ID = "mrSubscriberMessageStoreGroup";
58     public static final String DMAAP_MR_PUBLISHER_RECOVERY_MESSAGE_STORE_GROUP_ID = "mrPublisherRecoveryStoreGroup";
59
60     private DmaapMrConstants() {
61         // private constructor
62     }
63
64     /**
65      * getDmaapmappedHeaders
66      */
67     public static final Set<String> getDmaapmappedHeaders () {
68          return Stream.of(
69                 AnalyticsHttpConstants.REQUEST_ID_HEADER_KEY,
70                 AnalyticsHttpConstants.REQUEST_TRANSACTION_ID_HEADER_KEY,
71                 AnalyticsHttpConstants.REQUEST_BEGIN_TS_HEADER_KEY,
72                 AnalyticsHttpConstants.REQUEST_END_TS_HEADER_KEY).collect(Collectors.toSet());
73     }
74 }