This repository contains two simple Java console sample applications which access the IG REST and Streaming APIs:
-
ig-webapi-java-sample-console: A basic console based application which logs in via /session V2, retrieves a list of position, watchlist, subscribes to lightstreamer and create a position.
-
ig-webapi-java-sample-console-ui: A UI based console application (please increase the windows size to prevent scrolling) which shows a graph with the current market price and allows user to place a trade. Authentication is via /session V3.
-
Set the destination IG environment in environment.properties.
-
Open a command line / shell prompt and run mvn clean to install the Lighstreamer client in ig-webapi-java-client/lib to your local maven repository.
-
Run mvn clean install to build the project.
4.a) Run basic console app:
cd ig-webapi-java-sample-console
java -jar target\ig-webapi-java-sample-console-<project version>.jar <username> <password> <api key>
4.b) Run UI based console app
cd ig-webapi-java-sample-console-ui
java -jar target\ig-webapi-java-sample-console-ui-<project version>.jar <username> <password> <api key> [<optional epic>]
To attach a remote debugger: java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y -jar target\ig-webapi-java-sample-console...