question

Upvotes
Accepted

Not able to successfully post using example341__MarketPrice__OffStreamPost

We tried to publish using Elektron-SDK1.1.0.java API. We ran the example given in the API, changing some configuration and we are able to connect to the service but it is not able to publish the price, came back with Service Name not set & DeniedBySource error.

The following lines are updated when we ran the example

line no 263:

consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("wupra00a0186.wellsfargo.com:14002").username("sami_dev_contribute"));

line no 269:

longhandle = consumer.registerClient(reqMsg.clear().serviceName("UAT_MLIP").name(".WFCBTST1"), appClient, consumer);

line no 54 - 60

//FieldList is a collection in java

/*nestedFieldList.add(EmaFactory.createFieldEntry().real(22, 34, OmmReal.MagnitudeType.EXPONENT_POS_1));

nestedFieldList.add(EmaFactory.createFieldEntry().real(25, 35, OmmReal.MagnitudeType.EXPONENT_POS_1));

nestedFieldList.add(EmaFactory.createFieldEntry().time(18, 11, 29, 30));

nestedFieldList.add(EmaFactory.createFieldEntry().enumValue(37, 3));

*/

nestedFieldList.add(EmaFactory.createFieldEntry().real(6, 11, OmmReal.MagnitudeType.EXPONENT_POS_1));

Response message:

Jul 11, 2017 2:35:12 PM com.thomsonreuters.ema.access.ChannelCallbackClient reactorChannelEventCallback

INFO: loggerMsg

ClientName: ChannelCallbackClient

Severity: Info

Text: Received ChannelUp event on channel Channel

Instance Name EmaConsumer_1

Component Version ads2.6.10.L1.linux.tis.rrg 64-bit

loggerMsgEnd

Received Refresh. Item Handle: 0 Closure: com.thomsonreuters.ema.access.OmmConsumerImpl@1c4a1a27

Item Name: sami_dev_contribute

Service Name: <not set>

Item State: Open / Ok / None / 'Login accepted by host wupra00a0186.'

Name = AllowSuspectData DataType: UInt Value: 1

Name = ApplicationId DataType: Ascii Value: 256

Name = ApplicationName DataType: Ascii Value: ADS

Name = Position DataType: Ascii Value: 10.198.16.72/DTC8C0ADF8DD1E5

Name = ProvidePermissionExpressions DataType: UInt Value: 1

Name = ProvidePermissionProfile DataType: UInt Value: 0

Name = SingleOpen DataType: UInt Value: 1

Name = SupportOMMPost DataType: UInt Value: 1

Name = SupportPauseResume DataType: UInt Value: 0

Name = SupportStandby DataType: UInt Value: 0

Name = SupportBatchRequests DataType: UInt Value: 7

Name = SupportViewRequests DataType: UInt Value: 1

Name = SupportOptimizedPauseResume DataType: UInt Value: 0

Received AckMsg. Item Handle: 1 Closure: com.thomsonreuters.ema.access.OmmConsumerImpl@1c4a1a27

Item Name: .WFCBTST1

Service Name: not set

Ack Id: 1

Nack Code: DeniedBySource

Text: Unable to find service for post message.

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

10 Answers

Upvotes
Accepted
20.3k 73 10 20

Hi @Thirumal.Ponniahpillai

To submit an OffStream PostMsg you need an OmmConsumer instance and the Login Handle.

So, you can can post from wherever you want in you application as long you have access to the above two.

The above example uses event.handle() because the OnRefresh event is for the MMT_LOGIN. However, you can instead store the return value from when you can registerClient for MMT_LOGIN and use that when calling submit from somewhere other than the onRefresh.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
20.3k 73 10 20

Hi @Thirumal.Ponniahpillai

A few of things to note

  1. The line of code below is registering interesting in consuming the item - not posting
long handle = consumer.registerClient(reqMsg.clear().serviceName("UAT_MLIP").name(".WFCBTST1"), appClient, consumer);

2.The actual post is done using the submit() call in the onRefreshMsg() method e.g.

((OmmConsumer)event.closure()).submit( postMsg.postId( 1 ).serviceId( 1501 )
	.name( ".WFCBTST1" ).solicitAck( true ).complete(true)
	.payload(nestedRefreshMsg), event.handle() );

3. There is an outstanding issue with EMA Java in that the serviceName() method is not working. You need to use serviceId() call instead - after obtaining the correct service ID for the service from your Market Data team.

The development team are aware of the above issue and it should be fixed in a future build.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes

Hi Umer,

Thanks for the response. We got the service id pertained to our service UAT_MLIP ie 4300 and retried. It did not work, came back with similar error, pasted below. We are not sure if this is successful or not and it is not reflecting in the frontend.

On the other note, We are also trying to enable the logging using logback and even if I set root logger level to debug, we are not getting much logging out of API.

Also is there a any better example which I can use for post.

Received AckMsg. Item Handle: 1 Closure: com.thomsonreuters.ema.access.OmmConsumerImpl@35bfa910

Item Name: .WFCBTST1

Service Name: not set

Ack Id: 1

Nack Code: DeniedBySource

Text: .WFCBTST1

Received Status. Item Handle: 2 Closure: com.thomsonreuters.ema.access.OmmConsumerImpl@35bfa910

Item Name: .WFCBTST1

Service Name: UAT_MLIP

Item State: Open / Suspect / None / 'Request timeout'

Thanks & regards

--Thiru

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
20.3k 73 10 20

Hi @Thirumal.Ponniahpillai

A few things.

  1. Has your Market Data team confirmed that the MLIP_UAT source is able to receive Posts/ contributions for that particular RIC? Have they confirmed this works with some other existing application which posts successfully? Because it could be possible that the source has not been configured correctly. In which case they could raise a ticket with TREP support and get some assistance with the config
  2. With regards logging please see this post
  3. It is also possible to enable low level EMA message tracing using the XmlTraceToStdout=1 setting in your EMAConfig.xml file as described here

If your Market Data team are sure that MLIP_UAT is configured correctly, then you can upload some logging and the XmlTrace here for further analysis.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes

emajlog0.txtoutput.zip

Pls find the full trace and the log information and let us know if you see any obvious things to be fixed.


output.zip (493.4 KiB)
emajlog0.txt (8.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
38.1k 71 35 53
@Thirumal.Ponniahpillai

I have tested it with my contribution server (ATS). I don't have MarketLink. The ATS can accept the post message properly.

<POST domainType="MARKET_PRICE" streamId="1" containerType="MSG" flags="0x66 (HAS_POST_ID|HAS_MSG_KEY|POST_COMPLETE|ACK)" postId="1" postUserId="0" postUserAddr="0.0.0.0" dataSize="24">
    <key flags="0x03 (HAS_SERVICE_ID|HAS_NAME)" serviceId="267" name="TEST.BK"/>
    <dataBody>
        <REFRESH domainType="MARKET_PRICE" streamId="0" containerType="FIELD_LIST" flags="0x40 (REFRESH_COMPLETE)" groupId="0" State: Open/Ok/None - text: "" dataSize="8">
            <dataBody>
                <fieldList flags="0x08 (HAS_STANDARD_DATA)">
                    <fieldEntry fieldId="22" data="0F22"/>
                </fieldList>
            </dataBody>
        </REFRESH>
    </dataBody>
</POST>

<ACK domainType="MARKET_PRICE" streamId="1" containerType="NO_DATA" flags="0x12 (HAS_TEXT|HAS_MSG_KEY)" ackId="1" text="[1]: Contribution Accepted" dataSize="0">
    <key flags="0x03 (HAS_SERVICE_ID|HAS_NAME)" serviceId="267" name="TEST.BK"/>
    <dataBody>
    </dataBody>
</ACK>

In your case, the below AckMsg could be sent from the MarketLink server. You should contact the MarketLink team to verify the MarketLink's log to find the reason of NAK DeniedBySource.

Received AckMsg. Item Handle: 1 Closure: com.thomsonreuters.ema.access.OmmConsumerImpl@35bfa910
Item Name: .WFCBTST1
Service Name: not set
Ack Id: 1
Nack Code: DeniedBySource
Text: .WFCBTST1
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11.3k 25 8 13

@Thirumal.Ponniahpillai

As far as I know, the MarketLink IP can accept only the Post message which contains Update message as payload. Could you try modifying the example to use nested Update instead of Refresh?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

@Thirumal.Ponniahpillai

Veerapath is absolutely correct. Please see the tested update to EMA OffStreamPost example

...
PostMsg postMsg = EmaFactory.createPostMsg();
RefreshMsg nestedRefreshMsg = EmaFactory.createRefreshMsg();
UpdateMsg nestedUpdateMsg = EmaFactory.createUpdateMsg();
FieldList nestedFieldList = EmaFactory.createFieldList();
//FieldList is a collection in java
nestedFieldList.add(EmaFactory.createFieldEntry().real(22, 34, OmmReal.MagnitudeType.EXPONENT_POS_1));
nestedFieldList.add(EmaFactory.createFieldEntry().real(25, 35, OmmReal.MagnitudeType.EXPONENT_POS_1));
				
nestedUpdateMsg.payload(nestedFieldList );

((OmmConsumer)event.closure()).submit( postMsg.postId( 1 ).serviceId( 338)//1501 )
.name( "YOUR_INSTRUMENT_HERE" ).solicitAck( true ).complete(true)
.payload(nestedUpdateMsg), event.handle() );
...
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thanks for the suggestion. I have changed it to nested update, after that I am not getting ACK, is this mean, it's throwing exception now.

Exception in thread "pool-2-thread-1" Exception Type='OmmInvalidHandleException', Text='loggerMsg

ClientName: ItemCallbackClient

Severity: Error

Text: Attempt to use invalid Handle on submit(PostMsg). Instance name='Consumer_1_1'.

loggerMsgEnd

', Handle='0'

com.thomsonreuters.ema.examples.training.consumer.series300.example341__MarketPrice__OffStreamPost.AppClient.onRefreshMsg(Consumer.java:102)

Jirapongse avatar image Jirapongse Thirumal.Ponniahpillai
@Thirumal.Ponniahpillai

The exception showed that, at line Consumer.java:102, the application passed an invalid handle ('0'), when calling submit() method.

Could you please provide us with the source code (consumer.java)?

Upvotes

consumer.zipPls find the consumer.java.

thanks for help

--Thiru


consumer.zip (2.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you for the code.

From my test, the issue happens randomly. Sometimes, event.handle() returns zero which causes the exception. I will investigate the issue.

Thanks. Another thing we are trying to achieve through the offstream post, is bulk update/multiple updates for price. Do we need to do it through onrefresh callback way or there are other ways to achieve this.

Upvotes

Hi @Umer Nalla

Thanks for the details and it worked out well. We were able to submit using login handle successfully but the submission happens for every individual updates. Is there a way we can batch it and submit?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@Thirumal.Ponniahpillai

No, unfortunately. Batch posting is not supported by on-stream, nor off-stream.

Click below to post an Idea Post Idea