diff options
author | Izabela Zawadzka <izabela.zawadzka@nokia.com> | 2019-04-08 12:11:01 +0200 |
---|---|---|
committer | Izabela Zawadzka <izabela.zawadzka@nokia.com> | 2019-04-08 12:15:59 +0200 |
commit | c04fd10cc5e3b49e84f5a7a7d6da318891b591cb (patch) | |
tree | 8ccd367874f228cc7ddc117e64c4dd0ddb40e38b /rest-services/dmaap-client/src/main/java | |
parent | 46a1f850a2435ec8429565e805b8de82ba43f6db (diff) |
Fix DmaapClient
Change-Id: I9cd1dd62ccbedeead2655a4abe8f3e9bad5fb660
Signed-off-by: Izabela Zawadzka <izabela.zawadzka@nokia.com>
Issue-ID: DCAEGEN2-1404
Diffstat (limited to 'rest-services/dmaap-client/src/main/java')
2 files changed, 5 insertions, 3 deletions
diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/api/MessageRouterSubscriber.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/api/MessageRouterSubscriber.java index a063f66c..f3aba76d 100644 --- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/api/MessageRouterSubscriber.java +++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/api/MessageRouterSubscriber.java @@ -21,6 +21,7 @@ package org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.api; import com.google.gson.JsonElement; +import java.time.Duration; import org.onap.dcaegen2.services.sdk.rest.services.annotations.ExperimentalApi; import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.model.MessageRouterSubscribeRequest; import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.model.MessageRouterSubscribeResponse; @@ -47,7 +48,7 @@ public interface MessageRouterSubscriber { .flatMapMany(response -> Flux.fromIterable(response.items())); } - default Flux<JsonElement> subscribeForElements(MessageRouterSubscribeRequest request) { - return getElements(request).repeat(); + default Flux<JsonElement> subscribeForElements(MessageRouterSubscribeRequest request, Duration period) { + return Flux.interval(period).concatMap(i->getElements(request)); } } diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/model/MessageRouterSubscribeResponse.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/model/MessageRouterSubscribeResponse.java index 2e826784..13ec63cd 100644 --- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/model/MessageRouterSubscribeResponse.java +++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/model/MessageRouterSubscribeResponse.java @@ -33,7 +33,8 @@ import org.onap.dcaegen2.services.sdk.rest.services.annotations.ExperimentalApi; @Value.Immutable public interface MessageRouterSubscribeResponse extends DmaapResponse { - JsonArray items(); + @Value.Default + default JsonArray items() { return new JsonArray(); } @Value.Derived default boolean hasElements() { |