question

Upvotes
Accepted
53 2 5 6

POST Update does not clear fields

I have an application which POSTs REFRESH_COMPLETE messages for specific items using an OMMConsumer connection. When the upstream data source goes down it attempts to publish an empty refresh message, but this does not clear the last values stored in TREPS and clients still see the last values published before the "empty" REFRESH_COMPLETE. This seems strange as I would have thought the absence of the fields in the REFRESH should have indicated they were to be removed from the record.

Is there an alternative way (other than say publishing lots of 0s) to signify that a record is "unpublished" due to error

treprfarfa-apipost
icon clock
10 |1500

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

11 Answers

Upvote
Accepted
23.7k 84 10 22

Hi @alan.bain

When you say you tried to 'publish an UPDATE_STATUS' do you mean Post or actually publish?

I just modified the StarterConsumer_Post example that comes with the RFA Java devkit by adding the following line to the postInput.txt file

name=UMER2.TST type=offstream service=NIPROV ack=true id=true sequence=true part=single attrib=attribInfo payload=status_msg

The RIC UMER2.TST is an existing item in my ADH cache with valid fields.

I also changed the PostItemManager.createPayloadOMMMsg(Post postInfo) method as follows:

...
else if (postInfo.payloadType == OMMMsg.MsgType.STATUS_RESP)
        {
            _payloadOMMMsg.setMsgType(OMMMsg.MsgType.STATUS_RESP);
        }

        _payloadOMMMsg.setMsgModelType(RDMMsgTypes.MARKET_PRICE);
        _payloadOMMMsg.setState(OMMState.Stream.CLOSED, OMMState.Data.SUSPECT, OMMState.Code.NO_RESOURCES, "Gone Down!");


        // encode attribbInfo
        if (postInfo.bPayloadMsgAttribInfo == true)
        {
.....

Note: I only changed the _payloadOMMMsg.setState() line of code.

I then ran the StarterConsumer_Post example.

Once the above example was run, the UMER2.TST item was dropped from the cache and a consumer example that was already consuming the RIC, received a Status Msg with Closed, Suspect, No Resources. If I then try to consume the RIC again I get "F10: Item not in cache"

Or, if Add the record back to cache and then I change the above code to Stream.Open, Data.SUSPECT then my existing Consumer keeps the record open but receives the Suspect Status Msg.

icon clock
10 |1500

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

Upvote
23.7k 84 10 22

Hi @alan.bain

Do you expect the upstream data source loss to be a temporary situation?

If so, you could send a PostMsg with a StatusMsg with a StreamState of open, DataState of Suspect, a relevant StatusCode and some explanatory Status text

And then send a Refresh again once the upstream recovers with revised States to indicate all is OK.

Or, if you really want to mark the instrument as unavailable then you should send a StreamState of Closed and DataState of Suspect, along with a relevant StatusCode + text

icon clock
10 |1500

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

Upvotes
53 2 5 6

Thanks for this suggestion. I tried initially to publish an UPDATE_STATUS but RFA complained that this could not be done through an OMMConsumer. Then I changed to use a REFRESH_COMPLETE but with

outmsg.setState(OMMState.Stream.OPEN, OMMState.Data.SUSPECT, OMMState.Code.NONE, text);

However this didn't have the desired effect upstream.

icon clock
10 |1500

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

Upvotes
53 2 5 6

Also I'm publishing under the login stream (what is called "offstream posting" in Sec 13.6.3 of the RFAJ guide)

icon clock
10 |1500

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

I also tested with Off-stream - see below

Upvotes
53 2 5 6

When I try this I get

OMMConsumer submit() does not support message type OMMMsg.MsgType.STATUS_RESP; Supported message type(s) are OMMMsg.MsgType.POST and OMMMsg.MsgType.GENERIC

icon clock
10 |1500

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

Upvotes
23.7k 84 10 22

Hi @alan.bain

Are you modifying your own code or using the StarterConsumer_Post example app?

If you are using the example app, and you are not using the latest version of the RFA Java API then I recommend you re-test with the latest version from here.

If you are using the example app and the latest version of the API, then I recommend you open a ticket with our support team via the My Account - Incident page

If you are modifying your own code, I recommend just testing with the example initially. If then need further assistance with your code, then you could use the above link to open a ticket with our support team - so that you can share your code off line and get further assistance.

icon clock
10 |1500

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

Upvotes
53 2 5 6

Thanks. I am using 8.0.1E2, so will download the latest version.

I also tried posting on a stream rather then on the login handle and received the amazingly cryptic

A37: Cannot support on-stream posting for services which do not support posting.

icon clock
10 |1500

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

Upvotes
23.7k 84 10 22

Hi @alan.bain

That A37 message suggests that your TREP has been configured to NOT support on-stream posts.

icon clock
10 |1500

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

Upvotes
53 2 5 6

OK. With modifying the latest version I get

State: UNSPECIFIED, NO_CHANGE, NACK_NO_RESOURCES, "A42: Status message is not supported for services which do not support posting."

icon clock
10 |1500

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

Upvotes
23.7k 84 10 22

Hi @alan.bain

I recommend speaking to your Market Data support team. The explanation for the A42 message is as follows:

If the ADS receives a STATUS message for a source service that does not support posting, it sends this status text to the client application. The ADS cannot convert this into MF format for inserts.

The above suggests that the source you are Posting to is a legacy MF based service and not a pure OMM service and MF to OMM conversion facility cannot deal with Status Posts?

If they cannot explain why that particular service is not accepting the Status, then I recommend you open a support ticket for more detailed investigation.

icon clock
10 |1500

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

Upvote
53 2 5 6

Absolutely right. Seems I was on an old RTIC based service, switching to a newer one and everything works and I see stale when an error occurs. Thanks a lot for your help!

icon clock
10 |1500

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

You are welcome and thanks for the update.