...
Code Block |
---|
language | java |
---|
theme | RDark |
---|
title | Setting the Protocol property |
---|
linenumbers | true |
---|
|
# The http protocol to use:
# http
# https
final Properties props = new Properties();
props.setProperty("Protocol", "http");
mrConsumer.setProps(props); |
To fetch the following method needs to be called on the consumer object:
Code Block |
---|
language | java |
---|
theme | RDark |
---|
title | Fetch Method Example |
---|
linenumbers | true |
---|
|
mrConsumer.fetch() |
The POC used in the demo:
Code Block |
---|
language | java |
---|
theme | RDark |
---|
title | Demo POC code |
---|
linenumbers | true |
---|
collapse | true |
---|
|
public static void main(String[] args) throws Exception {
final Collection<String> hosts = new ArrayList<>();
hosts.add("message-router.onap:3904");
final MRConsumerImpl mrConsumer = new MRConsumerImpl.MRConsumerImplBuilder().setHostPart(hosts)
.setTopic("AAI-EVENT").setConsumerGroup("cg").setConsumerId("cid").setTimeoutMs(10000)
.setLimit(1000).setFilter("").setApiKey_username(null)
.setApiSecret_password(null).createMRConsumerImpl();
mrConsumer.setProtocolFlag("HTTPNOAUTH");
final Properties props = new Properties();
props.setProperty("Protocol", "http");
mrConsumer.setProps(props);
log.info("fetch {}", mrConsumer.fetch());
} |