...
Code Block | ||
---|---|---|
| ||
<properties> <sdk.version>1.1.4<5</sdk.version> </properties> |
...
Can be used like maven dependency to match generated password.
...
dmaap-client
- a DMaaP MR client
...
After parsing CBS sink definitions you will get a Source or Sink value object. It can be then directly used to communicate with DMaaP Message Router REST API:
Code Block | ||||
---|---|---|---|---|
| ||||
final MessageRouterPublisher publisher = DmaapClientFactory.createMessageRouterPublisher(); final MessageRouterSink sinkDefinition; //... Sink definition obtained by parsing CBS response final MessageRouterPublishRequest request = ImmutableMessageRouterPublishRequest.builder() .sinkDefinition(sinkDefinition) .build(); Flux.just(1, 2, 3) .map(JsonPrimitive::new) .transform(input -> cutpublisher.put(request, input)) .subscribe(resp -> { if (resp.successful()) { logger.debug("Sent a batch of messages to the MR"); } else { logger.warn("Message sending has failed: {}", resp.failReason()); } }, ex -> { logger.warn("An unexpected error while sending messages to DMaaP", ex); }); |
Note that we are using Reactor transform
operator. As an alternative you could assign Flux
of JSON values to the variable and then invoke publisher.put
on it. The important performance-related thing to remember is that you should feed the put
method with a stream of messages instead of multiple calls with single messages. This way the client API will be able to send them in batches which should significantly improve performance (at least on transfer level).
...
hvvesclient-producer
- a reference Java implementation of High Volume VES Collector client
...