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.web.config;
22 import org.onap.dcae.analytics.model.AnalyticsProfile;
23 import org.onap.dcae.analytics.web.BaseAnalyticsWebSpringBootIT;
24 import org.onap.dcae.analytics.web.dmaap.MrPublisherPreferences;
25 import org.onap.dcae.analytics.web.dmaap.MrSubscriberPreferences;
26 import org.springframework.context.annotation.Bean;
27 import org.springframework.context.annotation.Configuration;
28 import org.springframework.context.annotation.Profile;
29 import org.springframework.integration.channel.DirectChannel;
30 import org.springframework.integration.channel.QueueChannel;
31 import org.springframework.integration.dsl.IntegrationFlow;
32 import org.springframework.integration.dsl.IntegrationFlows;
33 import org.springframework.integration.handler.LoggingHandler;
36 * @author Rajiv Singla
39 @Profile({AnalyticsProfile.DMAAP_PROFILE_NAME})
40 public class DmaapMrTestConfig {
43 public MrSubscriberPreferences mrSubscriberPreferences() {
44 return new MrSubscriberPreferences(BaseAnalyticsWebSpringBootIT.TEST_SUBSCRIBER_TOPIC_URL, null,
45 null, BaseAnalyticsWebSpringBootIT.TEST_SUBSCRIBER_AAF_USERNAME,
46 BaseAnalyticsWebSpringBootIT.TEST_SUBSCRIBER_AAF_PASSWORD,
48 BaseAnalyticsWebSpringBootIT.TEST_SUBSCRIBER_CONSUMER_GROUP,
49 BaseAnalyticsWebSpringBootIT.TEST_SUBSCRIBER_CONSUMER_IDS,
54 public MrPublisherPreferences mrPublisherPreferences() {
55 return new MrPublisherPreferences(BaseAnalyticsWebSpringBootIT.TEST_PUBLISHER_TOPIC_URL);
59 public Integer processingBatchSize() {
65 public IntegrationFlow noOperationMrFlow(final QueueChannel mrSubscriberOutputChannel,
66 final DirectChannel mrPublisherInputChannel) {
67 return IntegrationFlows.from(mrSubscriberOutputChannel)
68 .log(LoggingHandler.Level.INFO)
69 .channel(mrPublisherInputChannel)