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
 
   9  *      http://www.apache.org/licenses/LICENSE-2.0
 
  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=========================================================
 
  20 package org.onap.dcae.analytics.model;
 
  23 import java.util.stream.Collectors;
 
  24 import java.util.stream.Stream;
 
  27  * @author Rajiv Singla
 
  29 public abstract class DmaapMrConstants {
 
  31     // ================== DMaaP MR CONSTANTS ============================== //
 
  33     public static final Set<String> DMAAP_MAPPED_HEADERS = Stream.of(
 
  34             AnalyticsHttpConstants.REQUEST_ID_HEADER_KEY,
 
  35             AnalyticsHttpConstants.REQUEST_TRANSACTION_ID_HEADER_KEY,
 
  36             AnalyticsHttpConstants.REQUEST_BEGIN_TS_HEADER_KEY,
 
  37             AnalyticsHttpConstants.REQUEST_END_TS_HEADER_KEY).collect(Collectors.toSet());
 
  41     public static final String SUBSCRIBER_EMPTY_MESSAGE_RESPONSE_STRING = "[]";
 
  42     public static final String SUBSCRIBER_RANDOM_CONSUMER_GROUP_PREFIX = "DCAE-SUB-";
 
  43     public static final String SUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME = "timeout";
 
  44     public static final Integer SUBSCRIBER_DEFAULT_TIMEOUT = -1;
 
  45     public static final Integer SUBSCRIBER_DEFAULT_FIXED_POLLING_INTERVAL = 30_000;
 
  46     public static final String SUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME = "limit";
 
  47     public static final Integer SUBSCRIBER_DEFAULT_MESSAGE_LIMIT = 50_000;
 
  48     public static final Integer SUBSCRIBER_DEFAULT_PROCESSING_BATCH_SIZE = 10_000;
 
  51     // =================== INTEGRATION DEFAULTS =========================== //
 
  54     public static final Integer DEFAULT_NUM_OF_RETRIES_ON_FAILURE = 5;
 
  55     public static final Integer DEFAULT_RETRY_INITIAL_INTERVAL = 1_000;
 
  56     public static final Integer DEFAULT_RETRY_MULTIPLIER = 5;
 
  57     public static final Integer DEFAULT_RETRY_MAX_INTERVAL = 300_000;
 
  59     public static final String DMAAP_MR_SUBSCRIBER_OUTPUT_CHANNEL_NAME = "mrSubscriberOutputChannel";
 
  60     public static final String DMAAP_MR_PUBLISHER_INPUT_CHANNEL = "mrPublisherInputChannel";
 
  61     public static final String DMAAP_MR_PUBLISHER_OUTPUT_CHANNEL = "mrPublisherOutputChannel";
 
  63     // MESSAGE STORE NAMES
 
  64     public static final String DMAAP_MR_SUBSCRIBER_OUTPUT_MESSAGE_STORE_GROUP_ID = "mrSubscriberMessageStoreGroup";
 
  65     public static final String DMAAP_MR_PUBLISHER_RECOVERY_MESSAGE_STORE_GROUP_ID = "mrPublisherRecoveryStoreGroup";
 
  67     public DmaapMrConstants() {
 
  68         // private constructor