diff options
author | Jim Hahn <jrh3@att.com> | 2018-04-19 16:08:20 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2018-04-19 16:08:44 -0400 |
commit | ad73d3c3e46b2de77ee0a97788c51896a3fd36de (patch) | |
tree | 4403991f2f84b1689ca9902ecbe68bbbf989d531 /policy-endpoints | |
parent | dbdef1e3e3803b5848a1fad746c652f9359d4313 (diff) |
Set default consumer instance to hostname
Modified the code to generate a consumer instance via UUID,
when no consumer instance is provided.
Removed DEFAULT_CONSUMER_INSTANCE.
Set the consumer instance to the hostname instead of a UUID.
Change-Id: I143eb6d2ec51a7913536a46041de761d51222006
Issue-ID: POLICY-749
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints')
2 files changed, 3 insertions, 7 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/BusTopicSource.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/BusTopicSource.java index 4ef8e2d6..83d4e72c 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/BusTopicSource.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/BusTopicSource.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * policy-endpoints * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,11 +29,6 @@ import org.onap.policy.drools.event.comm.TopicSource; public interface BusTopicSource extends ApiKeyEnabled, TopicSource { /** - * Default Consumer Instance Value - */ - public static String DEFAULT_CONSUMER_INSTANCE = "0"; - - /** * Default Timeout fetching in milliseconds */ public static int DEFAULT_TIMEOUT_MS_FETCH = 15000; diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java index 9b2be6a9..5e8cf489 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java @@ -31,6 +31,7 @@ import org.onap.policy.drools.event.comm.FilterableTopicSource; import org.onap.policy.drools.event.comm.TopicListener; import org.onap.policy.drools.event.comm.bus.BusTopicSource; import org.onap.policy.drools.event.comm.bus.internal.BusConsumer.FilterableBusConsumer; +import org.onap.policy.drools.utils.NetworkUtil; /** * This topic source implementation specializes in reading messages @@ -126,7 +127,7 @@ public abstract class SingleThreadedBusTopicSource } if (consumerInstance == null || consumerInstance.isEmpty()) { - this.consumerInstance = DEFAULT_CONSUMER_INSTANCE; + this.consumerInstance = NetworkUtil.getHostname(); } else { this.consumerInstance = consumerInstance; } |