Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
themeRDark
titleSetting the Protocol property
linenumberstrue
# 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
languagejava
themeRDark
titleFetch Method Example
linenumberstrue
mrConsumer.fetch()

The POC used in the demo:

Code Block
languagejava
themeRDark
titleDemo POC code
linenumberstrue
collapsetrue
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());
}