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 requiredLongitude=Not requiredVersion=Not requiredServiceName=Not requiredEnvironment=Not requiredPartner=Not requiredrouteOffer=Not requiredSubContextPath=Not requiredProtocol=http or httpsMethodType=Not Requiredusername=username for authenticationpassword=password for authenticationcontenttype=application/json or text/plainhost=MR hosttopic=Topic to connectgroup=Consumer Group for topic subscriptionid=Consumer ID for topic subscriptiontimeout=consumer timeoutlimit=number of datasets to consumefilter=Not RequiredAFT_DME2_EXCHANGE_REQUEST_HANDLERS=Not RequiredAFT_DME2_EXCHANGE_REPLY_HANDLERS=Not RequiredAFT_DME2_REQ_TRACE_ON=Not RequiredAFT_ENVIRONMENT=Not RequiredAFT_DME2_EP_CONN_TIMEOUT=Not RequiredAFT_DME2_ROUNDTRIP_TIMEOUT_MS=Not RequiredAFT_DME2_EP_READ_TIMEOUT_MS=Not Requiredsessionstickinessrequired=NoDME2preferredRouterFilePath=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