com.paritytrading.philadelphia.FIXConfig Java Examples

The following examples show how to use com.paritytrading.philadelphia.FIXConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TerminalClient.java    From philadelphia with Apache License 2.0 6 votes vote down vote up
private static void main(Config config, List<String> lines) throws IOException {
    String version      = config.getString("fix.version");
    String senderCompId = config.getString("fix.sender-comp-id");
    String targetCompId = config.getString("fix.target-comp-id");
    int    heartBtInt   = config.getInt("fix.heart-bt-int");
    String address      = config.getString("fix.address");
    int    port         = config.getInt("fix.port");

    FIXConfig.Builder builder = new FIXConfig.Builder()
        .setVersion(FIXVersion.valueOf(version))
        .setSenderCompID(senderCompId)
        .setTargetCompID(targetCompId)
        .setHeartBtInt(heartBtInt)
        .setMaxFieldCount(1024)
        .setFieldCapacity(1024)
        .setRxBufferCapacity(1024 * 1024)
        .setTxBufferCapacity(1024 * 1024);

    TerminalClient.open(new InetSocketAddress(address, port), builder.build()).run(lines);
}
 
Example #2
Source File: FIXAcceptor.java    From parity with Apache License 2.0 5 votes vote down vote up
private FIXAcceptor(OrderEntryFactory orderEntry,
        ServerSocketChannel serverChannel, String senderCompId,
        Instruments instruments) {
    this.orderEntry = orderEntry;

    this.serverChannel = serverChannel;

    this.config = new FIXConfig.Builder()
        .setVersion(FIXVersion.FIX_4_4)
        .setSenderCompID(senderCompId)
        .build();

    this.instruments = instruments;
}
 
Example #3
Source File: Session.java    From philadelphia with Apache License 2.0 4 votes vote down vote up
static Session open(InetSocketAddress address,
        FIXConfig config, FIXMessageListener listener,
        FIXConnectionStatusListener statusListener) throws IOException {
    SocketChannel channel = SocketChannel.open();

    channel.connect(address);
    channel.configureBlocking(false);

    Selector selector = Selector.open();

    channel.register(selector, SelectionKey.OP_READ);

    FIXConnection connection = new FIXConnection(channel, config, listener, statusListener);

    return new Session(selector, connection);
}
 
Example #4
Source File: Session.java    From parity with Apache License 2.0 4 votes vote down vote up
Session(OrderEntryFactory orderEntry, SocketChannel fix,
        FIXConfig config, Instruments instruments) throws IOException {
    this.nextOrderEntryId = 1;

    this.orders = new Orders();

    OrderEntryListener orderEntryListener = new OrderEntryListener();

    this.orderEntry = orderEntry.create(orderEntryListener, orderEntryListener);

    FIXListener fixListener = new FIXListener();

    this.fix = new FIXConnection(fix, config, fixListener, fixListener);

    this.instruments = instruments;
}
 
Example #5
Source File: TerminalClient.java    From philadelphia with Apache License 2.0 3 votes vote down vote up
static TerminalClient open(InetSocketAddress address, FIXConfig config) throws IOException {
    Messages messages = new Messages();

    Session session = Session.open(address, config, messages, messages);

    return new TerminalClient(messages, session);
}