Dmaap

Property file description

TransportType= Based on this property, API will create a request to MR with or with out authentication headers. Accepted Values:HTTPNOAUTH,HTTPAAF,HTTPAUTH(Required only if API keys are used for authentication)
Latitude= Not required
Longitude=Not required
Version=Not required
ServiceName=Not required
Environment=Not required
Partner=Not required
routeOffer=Not required
SubContextPath=Not required
Protocol=http or https
MethodType=Not Required
username=username for authentication
password=password for authentication
contenttype=application/json or text/plain
host=MR host
topic=Topic to connect
group=Consumer Group for topic subscription
id=Consumer ID for topic subscription
timeout=consumer timeout
limit=number of datasets to consume
filter=Not Required
AFT_DME2_EXCHANGE_REQUEST_HANDLERS=Not Required
AFT_DME2_EXCHANGE_REPLY_HANDLERS=Not Required
AFT_DME2_REQ_TRACE_ON=Not Required
AFT_ENVIRONMENT=Not Required
AFT_DME2_EP_CONN_TIMEOUT=Not Required
AFT_DME2_ROUNDTRIP_TIMEOUT_MS=Not Required
AFT_DME2_EP_READ_TIMEOUT_MS=Not Required
sessionstickinessrequired=No
DME2preferredRouterFilePath=Not required

Example producer and consumer

code snippets
//publishing of messages
MRBatchingPublisher publisher = MRClientFactory.createBatchingPublisher(App.class.getClassLoader().getResource("dmaap.properties").getPath(), true);
final JSONObject msg1 = new JSONObject();
msg1.put("Message1", "Message1");
publisher.send(msg1.toString());
MRPublisherResponse response = publisher.sendBatchWithResponse();
System.out.println("Publisher Response: " + response.toString());

//consuming of messages
MRConsumer consumer = MRClientFactory.createConsumer(App.class.getClassLoader().getResource("dmaap.properties").getPath());
MRConsumerResponse response = consumer.fetchWithReturnConsumerResponse();
System.out.println("response code :" + response .getResponseCode());
System.out.println("response message :" + response .getActualMessages());
config for snippet
TransportType=HTTPNOAUTH
Protocol=http
contenttype=application/json
host=10.12.7.22:30227
topic=AAI-EVENT
group=CG
id=C1
timeout=15000
limit=1000
maxBatchSize=50
maxAgeMs=1000
MessageSentThreadOccurance=50
  • No labels