A remote server vends Barchart's market data feed. This client library uses socket.io to access the feed and allows clients to:
- Request basic Profile data for individual symbols
- Subscribe to Quote updates for individual symbols
The project can be built with maven. Please refer to the pom.xml file in the barchart-streaming-client directory.
cd [project-directory]/barchart-streaming-client
mvn clean
mvn install
A simple example can be found in the barchart-streaming-client-test directory. There is no need to include this project with your application.
Please refer to the main method of:
com.barchart.streaming.test.StreamingTestClient
The Barchart market data server uses socket.io[http://socket.io] endpoints. This library is a convenience-wrapper. So, instead of making the socket.io connection directly, consumers can make single-line method calls to perform asynchronous operations (e.g. subscribe quotes, subscribe prices, get profile).
MarketSocketConnection c = new MarketSocketConnection();
c.connect();
final MutableQuote tsla = new BasicMutableQuote("TSLA");
c.subscribeToPriceChanges(tsla.getSymbol(), new Action<Synchronizer<MutableQuote>>() {
@Override
public void execute(Synchronizer<MutableQuote> synchronizer) {
synchronizer.synchronize(tsla);
}
});
Manages the underlying connection to the JERQ market data server, gracefully handling any network connectivity issues.
Three primary operations exist:
- subscribeToQuotes - Creates a subscription for a symbol. Changes are published when any property of the Quote changes. This method updates very frequently.
- subscribeToPriceChanges - Creates a subscription for a symbol. Changes are published only when a trade occurs at a different price level. This method updates far less frequently than the "subscribeToQuotes" method.
- requestProfile - Asynchronous lookup symbol metadata.
All operations are thread-safe.
The contract for an instrument quote that can be updated.
Each time the quote changes, a Synchronizer will be generated. This synchronizer will update any properties of the MutableQuote which have changed.
The implementation of this interface is the responsibility of the client. In a user interface, setter methods could be written to perform data-binding.
A thread-safe mechanism for updating a data structure.
The staging environment can be used for testing.
jerq-aggregator-stage.aws.barchart.com
The production environment has not been defined.
Please email bryan.ingle@barchart.com.