In this example ex370_MP_Batch, how can we obtain handle and closure object for each of the elements which are a part of the array?
public class Consumer
{
public static void main(String[] args)
{
OmmConsumer consumer = null;
try
{
AppClient appClient = new AppClient();
consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("localhost:14002").username("user"));
ElementList batch = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
array.add(EmaFactory.createOmmArrayEntry().ascii("TRI.N"));
array.add(EmaFactory.createOmmArrayEntry().ascii("IBM.N"));
batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));
consumer.registerClient(EmaFactory.createReqMsg().serviceName("DIRECT_FEED").payload(batch), appClient);
Thread.sleep(60000); // API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()
}
catch (InterruptedException | OmmException excp)
{
System.out.println(excp.getMessage());
}
finally
{
if (consumer != null) consumer.uninitialize();
}
}
}
Here in above code, how can we obtain a handle as response for each of the elements in the array?
Right now, we receive only one handle object when we register OmmConsumerClient object for the batch request.