When I am trying to publish Data using the postMsg method getting below error
Failed to submit PostMsg on item stream. Reason: ReactorReturnCodes.INVALID_USAGE. Error text: Cannot submit PostMsg when stream not in open state.
Code snippet using as below
OmmConsumer consumer = null;
AppClient appClient = new AppClient();
OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();
consumer = EmaFactory.createOmmConsumer(
config.host("localhost:14002").username("user") );
ReqMsg reqMsg = EmaFactory.createReqMsg();
long closure = 1;
long itemHandle = consumer.registerClient( reqMsg.serviceName( "servicename" ).name(
"name" ), appClient, closure );
reqMsg.clear();
PostMsg postMsg = EmaFactory.createPostMsg();
FieldList nestedFieldList = EmaFactory.createFieldList();
nestedFieldList.add( EmaFactory.createFieldEntry().uintValue(1, 100) );
consumer.submit( postMsg.payload(nestedFieldList), itemHandle );
Thread.sleep(60000);
}