Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Velocity Analytics /
avatar image
Question by yokoyama · Sep 05, 2018 at 03:34 AM · apijavavelocity-analytics

How to connect to Velocity Analytics 8 using API

I tried connecting to Velocity Analytics 8, but an error occurred in the middle process.

ClassCastException is output with the following method.
DeltaQRoundRobinConnectionFactory.loadHostListFromCurrentConnection ()

The processing flow is as follows.

Generate DefaultDeltaStream
Run InitialiseDeltaControl()
A log of DeltaCConnectorThread is output and a message of Connection thread completed is output.
It ends immediately with ClassCastException.

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.

8 Replies

  • Sort: 
avatar image
Best Answer
Answer by Pavel.Hurynovich · Sep 13, 2018 at 03:43 AM

Hello Yokoyama Ryouta,

To connect to the GW process you can use Java driver from Kx Systems. It's an interface for kdb+, check link below:

https://code.kx.com/q/interfaces/java-client-for-q/

You need to use c.java class, create connection to your gateway and send query as sync message. Example:

c c=null; //connection object
c=new c("host",5010,"username:password"); //create connection
Object result=c.k("your query here"); //send a sync message and 
recieve resultc.Flip flip = c.td(result); //convert result object to 
c.Flip
Comment

People who like this

0 Show 0 · 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
Answer by Pavel.Hurynovich · Sep 07, 2018 at 11:36 AM

Hello Yokoyama Ryouta,

As I understand you trying to pass incorrect object instance to DeltaStream.initialiseDeltaControl() method:

https://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ClassCastException.html

InitialiseDeltaControl signatures:

void initialiseDeltaControl(ConfigurationManager var1); 

void initialiseDeltaControl(ConfigurationManager var1, String var2); 

void initialiseDeltaControl(String var1, int var2, String var3, int var4, String var5, int var6, boolean var7, String var8, int var9, int var10, boolean var11) throws DeltaStreamException; 

void initialiseDeltaControl(String var1, Integer var2, String var3, Integer var4, String var5, Integer var6, Boolean var7, String var8, Integer var9, Integer var10, Boolean var11, Boolean var12) throws DeltaStreamException;

Example of InitialiseDeltaControl call:

deltaStream.initialiseDeltaControl(primaryHost, primaryPort.intValue(), secondaryHost, secondaryPort.intValue(),instanceName, instanceId.intValue(), exclusive.booleanValue(), loginString,retryMaxTimeOutPeriod.intValue(), retryTimeoutStep.intValue(), encrypted.booleanValue());

note that host parameters should be passed as String objects, port - as Int.

Hope this helps.

Comment

People who like this

0 Show 0 · 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
Answer by yokoyama · Sep 09, 2018 at 09:57 PM

Hello Hurynovich,

Thank you for your response.

I understood that an exception occurred in initialiseDeltaControl.
I reconfirmed the call of initialiseDeltaControl, but I have not found a problem.
I am coding as follows, but where is the problem?
Note: IP, ID and PW are masked.

private DeltaStream createStream() throws DeltaStreamException {
    DeltaStream stream = DeltaStreamFactory.newDeltaStream();
    stream.initialiseDeltaControl(
        "XX.XX.XX.XX.", //primaryhost
        1234,//primaryport
        null,//secondaryhost
        0,//secondaryport
        "Develop",//instancename
        0,//instanceId
        true,//exclusive
        "XXXXXXX:XXXX",//loginString
        10000,//retryMaxTimeOutPeriod
        1000,//retryTimeoutStep
        false //encrypted
    );
Comment

People who like this

0 Show 0 · 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
Answer by Pavel.Hurynovich · Sep 11, 2018 at 01:15 AM

Hello Yokoyama Ryouta,

Code looks right, can you please recheck is "stream" object an instance of DefaultDeltaStream and all values passed into initialiseDeltaControl method have right types? Also which version of VA binaries you use? I've tested this code and it works

Comment

People who like this

0 Show 0 · 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
Answer by yokoyama · Sep 11, 2018 at 11:23 PM

Hello Hurynovich,
thank you so much for your reply.
I may be making a misunderstanding.
When executing the q command using the Delta IDE, I am connected to the Gateway process.
For this reason, I thought that the VA8 Java API will connect to the Gateway process as well, but is this understanding wrong?
If you designate the destination Port as a DeltaControl process, ClassCastException no longer occurs.

Comment

People who like this

0 Show 0 · 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
Answer by Pavel.Hurynovich · Sep 12, 2018 at 04:22 AM

Hello Yokoyama Ryouta,

You are welcome! That's right - VA8 C#/Java API should be connected to main DC port (same port using for connection to your VA instance in DeltaControl application).

Comment

People who like this

0 Show 0 · 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
Answer by yokoyama · Sep 12, 2018 at 10:06 PM

Hello Hurynovich,
Thanks to your answer, I was able to correct my wrong understanding.
By the way, do you know how to connect to the Gateway process using Java and get data?

Comment

People who like this

0 Show 0 · 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
Answer by yokoyama · Sep 14, 2018 at 04:26 AM

Hello Hurynovich,
I was able to connect to the Gateway process and retrieve the data.
I greatly appreciate your help.

Comment

People who like this

0 Show 0 · 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.

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 >
10 People are following this question.

Related Questions

Velocity Analytics 8 - How to solve com.kx.q.c$KException

Velocity Analytics 8 - Connect to QueryRouter

Error: The query was not successfully performed! Correction hint: length

When entering the Filter Rules dashboard there is some idling (“Loading”) going on until I get a timeout.

  • 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