Hi,
I have a requirement that I need to create a database of snapshot values for a list of RICs in a given interval say 15 minutes.
I have the below code that runs for every 15 minutes and it did the job.
OmmConsumer consumer = EmaFactory.createOmmConsumer(config);
ElementList ricBatch = EmaFactory.createElementList();
ricBatch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, ommArray));
//Specify Dynamic view of fields
ricBatch.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
ricBatch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, fields));
ReqMsg ricReqMsg = EmaFactory.createReqMsg().serviceName(adsService).payload(ricBatch) .interestAfterRefresh(false);
consumer.registerClient(ricReqMsg, this);
//wait for snapshot request to be fulfilled
consumer.uninitialize();
Obviously I see that EMA API creates a new consumer thread with new ads connection for each of the snapshot call.
Is there a better do this , that optimized the resources and reuses the connection to ADS server ?
Thanks in advance
Mani