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.
Best Answer
-
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.Flip0
Answers
-
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.
0 -
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
);0 -
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
0 -
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.0 -
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).
0 -
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?0 -
Hello Hurynovich,
I was able to connect to the Gateway process and retrieve the data.
I greatly appreciate your help.0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛