Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by Catherine Wong · Feb 10, 2016 at 01:00 AM · treprfarfa-apijava

How to encode msgKey attribute in RFA Java

RFA Java provides the OMMAttribInfo.getAttrib() method, but not setAttrib() method. What should I do to set the Attrib to OMMAttribInfo object?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Nipat Kunvutipongsak · Feb 24, 2016 at 11:16 PM

@Catherine Wong

According to the document (<RFA_PACKAGE>/Docs/refman/rfajava/com/reuters/rfa/omm/OMMEncoder.html), if the application wants to encode attrib, it must not specify the second parameter as OMMTypes.NO_DATA.

encodeMsgInit
void encodeMsgInit(OMMMsg msg,
                   short attibDataType,
                   short dataType)

OMMMsg encoding initialization


Parameters:

msg - the message to be encoded.

attibDataType - the data type that is contained in the OMMAttribInfo. OMMTypes.NO_DATA if encoded OMMAttribInfo will not contain OMMData (i.e. OMMAttribInfo.getAttrib()).

dataType - the data type that is contained in the message. OMMTypes.NO_DATA if encoded message will not contain data.

Referring to RFA Java RDM Usage guide, OMMAttribInfo.Attrib is not used in most of domains except a Login domain.

Since the RFA example applications usually manage the administrative domain (Login, Source Directory, and Dictionary) automatically, you can find the simple demonstration from a LoginClient.encodeLoginReqMsg() method of a StarterConsumer example.

Please see the snippet code below:

    private OMMMsg encodeLoginReqMsg()
    {
        OMMEncoder encoder = _mainApp.getEncoder();
        OMMPool pool = _mainApp.getPool();
        encoder.initialize(OMMTypes.MSG, 500);
        OMMMsg msg = pool.acquireMsg();
        msg.setMsgType(OMMMsg.MsgType.REQUEST);
        msg.setMsgModelType(RDMMsgTypes.LOGIN);
        msg.setIndicationFlags(OMMMsg.Indication.REFRESH);
        msg.setAttribInfo(null, CommandLine.variable("user"), RDMUser.NameType.USER_NAME);


        encoder.encodeMsgInit(msg, OMMTypes.ELEMENT_LIST, OMMTypes.NO_DATA);
        encoder.encodeElementListInit(OMMElementList.HAS_STANDARD_DATA, (short)0, (short)0);
        encoder.encodeElementEntryInit(RDMUser.Attrib.ApplicationId, OMMTypes.ASCII_STRING);
        encoder.encodeString(CommandLine.variable("application"), OMMTypes.ASCII_STRING);
        encoder.encodeElementEntryInit(RDMUser.Attrib.Position, OMMTypes.ASCII_STRING);
        encoder.encodeString(CommandLine.variable("position"), OMMTypes.ASCII_STRING);
        encoder.encodeElementEntryInit(RDMUser.Attrib.Role, OMMTypes.UINT);
        encoder.encodeUInt((long)RDMUser.Role.CONSUMER);
        encoder.encodeAggregateComplete();


        // Get the encoded message from the encoder
        OMMMsg encMsg = (OMMMsg)encoder.getEncodedObject();


        // Release the message that own by the application
        pool.releaseMsg(msg);


        return encMsg; // return the encoded message
    }

Below is an application log:

MESSAGE
	Msg Type: MsgType.REQUEST
	Msg Model Type: LOGIN
	Indication Flags: REFRESH
	Hint Flags: HAS_ATTRIB_INFO
	AttribInfo
		Name: U0154418
		NameType: 1 (USER_NAME)
		Attrib
			ELEMENT_LIST
				ELEMENT_ENTRY ApplicationId: 256
				ELEMENT_ENTRY Position: 10.42.85.159/U0154418-TPL-A
				ELEMENT_ENTRY Role: 0
	Payload: None

Hope this helps!

Comment
piyasak.chansaengsai

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Catherine Wong · Feb 25, 2016 at 03:42 AM 0
Share

It looks like what I want. I can attach some parameters in msg.Attrib along with the request message.

MESSAGE
	Msg Type: MsgType.REQUEST
	Msg Model Type: Unknown Msg Model Type: 254
	Indication Flags: REFRESH
	Hint Flags: HAS_ATTRIB_INFO | HAS_QOS_REQ
	QosReq: (RT, TbT)
	AttribInfo
		ServiceId: 1
		Name: CW_TEST_CUSTOM_RIC
		NameType: 1
		Attrib
			ELEMENT_LIST
				ELEMENT_ENTRY startDate: 01/01/2016
				ELEMENT_ENTRY stopDate: 25/02/2016
				ELEMENT_ENTRY threshold: 3
	Payload: None

avatar image
REFINITIV
Answer by zoya faberov · Feb 10, 2016 at 11:11 AM

In RFA Java 8 kit, please see framework => provider => DictionaryStreamItem:

...

OMMAttribInfo attribInfo = pool.acquireAttribInfo();

attribInfo.setServiceName(_dictMgr.getServiceName());

attribInfo.setName(_name);

attribInfo.setFilter(filter); // Specifies all of the normally needed

// data will be sent.

msg.setAttribInfo(attribInfo);

enc.encodeMsgInit(msg, OMMTypes.NO_DATA, OMMTypes.SERIES); // Data is

...
Comment
piyasak.chansaengsai

People who like this

1 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Catherine Wong · Feb 12, 2016 at 05:03 AM 0
Share

@zoya.farbefov

Thanks, but if I just want to add ElementList in the msgKey too? How can I set it to OMMAttribInfo object. It provides setFilter(), setId(), setName(), setNameType(), setServiceID() and setServiceName() only.

avatar image
REFINITIV
zoya faberov ♦♦ Catherine Wong · Feb 22, 2016 at 09:20 AM 0
Share

I think you are looking to encode ElementList into message itself ( you are writing a provider) as OMMAttribInfo is designed to provide optional attributes/hints.

Please see in reference OMMEncoder for specifics on how to encode and complete on OMMData, OMMEelemntList is OMMData.

Please see example of Series encoding in provider => DictionaryStreamItem, it is the same approach.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
3 People are following this question.

Related Questions

Multiple servers and services in a single RFA configuration file

Subscribing to RIC multiple times

how can i decode a page data such as "LIBOR01" to get the interests by the name of certain rows

What is the best way to decode the OMMMsgs received (e.g. to get prices) when subscribing to a RIC using RFA?

MARKET_BY_PRICE no size

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges