Hi,
I am trying to post a message on RTMDS connectivity (no tunnel stream), but the response to the post request is this error message
2023-05-23 10:44:52.704 ERROR 37860 --- [pool-2-thread-1] c.refinitiv.ema.access.OmmConsumerImpl : loggerMsg
ClientName: ItemCallbackClient
Severity: Error
Text: Attempt to use invalid Handle on submit(PostMsg). Instance name='EmaConsumer_1'.
loggerMsgEnd
Sample code:
...
try {
System.out.println("Contributing to Refinitiv Contributions Channel");
//Parsing Program arguments.
OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();
Common.readCommandlineArgs(args,config);
if (Common.userName != null) config.username(Common.userName);
_ommConsumer = EmaFactory.createOmmConsumer(config.host(Common.host));
//Register to get the login and source directory message
Login.LoginReq loginReq = EmaFactory.Domain.createLoginReq();
_ommConsumer.registerClient(loginReq.message(), this);
_ommConsumer.registerClient(EmaFactory.createReqMsg().domainType(EmaRdm.MMT_DIRECTORY).serviceName(trceServiceName), this);
Thread.sleep(60000);
} catch (InterruptedException | OmmException excp) {
System.out.println(excp.getMessage());
}
...
@Override
public void onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent event) {
try {
System.out.println("----- Refresh message ----");
System.out.println(refreshMsg);
if (refreshMsg.domainType() == EmaRdm.MMT_LOGIN && refreshMsg.state().streamState() == OmmState.StreamState.OPEN && refreshMsg.state().dataState() == OmmState.DataState.OK) {
// 3. Login accepted, app can post data now
System.out.println("Login accepted, starting posting...");
_postStreamID = refreshMsg.streamId();
postMessage();
} else {
System.out.println("Stream not open");
}
} catch (OmmException excp) {
System.out.println(excp.getMessage());
}
}
...
private void postMessage() {
try {
Thread.sleep(300);
} catch (Exception e) {
}
// populate the contributed FIDs and values
FieldList nestedFieldList = EmaFactory.createFieldList();
nestedFieldList.add(EmaFactory.createFieldEntry().real(22, _bid++, OmmReal.MagnitudeType.EXPONENT_NEG_1));
nestedFieldList.add(EmaFactory.createFieldEntry().real(25, _ask++, OmmReal.MagnitudeType.EXPONENT_NEG_1));
// create an update message for our item
UpdateMsg nestedUpdateMsg = EmaFactory.createUpdateMsg()
.streamId(_postStreamID)
.name(trceItem)
.payload(nestedFieldList);
// post this market price message
_ommConsumer.submit(EmaFactory.createPostMsg()
.streamId(_postStreamID)
.postId(_postID++)
.domainType(EmaRdm.MMT_MARKET_PRICE)
.solicitAck(true)
.complete(true)
.payload(nestedUpdateMsg), _subStreamHandle);
}
....
Any idea?