2

QuickFIX/J 包含用于创建四个数据库表的 SQL 脚本:

  • sessions
  • messages
  • messages_log
  • event_log

我找不到任何描述这些表格用途的文档。

它们的用途是什么,它们何时被写入,它们中的任何一个是否会无限增长,等等......

4

1 回答 1

12

一些表用于存储,另一些用于记录*_log表) 。QuickFIX/J 需要存储才能运行(它跟踪会话状态并支持重新发送消息),而日志是可选的。


sessions

此表跟踪活动的 FIX 会话。会话具有primary key下面声明中显示的八个值的组合键。

creation_time用于确定这适用于哪个会话。

*_seqnum列跟踪会话的当前序列号,并与重新发送请求一起用于可靠性。

create table sessions (
  beginstring  char(8) not null,
  sendercompid varchar(64) not null,
  sendersubid  varchar(64) not null,
  senderlocid  varchar(64) not null,
  targetcompid varchar(64) not null,
  targetsubid  varchar(64) not null,
  targetlocid  varchar(64) not null,
  session_qualifier varchar(64) not null,
  creation_time timestamp not null,
  incoming_seqnum integer not null,
  outgoing_seqnum integer not null,
  primary key (beginstring, sendercompid, sendersubid, senderlocid,
               targetcompid, targetsubid, targetlocid, session_qualifier)
);

messages

此表提供在活动会话期间发送的 FIX 消息的持久存储。如果正在与之通信的一方需要重新发送消息,QuickFIX/J 将使用此表来确定消息的内容。

在每个会话开始时,session_qualifier删除 的消息。因此,该表不会无限增长,其大小的上限取决于会话期间可以发送多少消息。

create table messages (
  beginstring char(8) not null,
  sendercompid varchar(64) not null,
  sendersubid varchar(64) not null,
  senderlocid varchar(64) not null,
  targetcompid varchar(64) not null,
  targetsubid varchar(64) not null,
  targetlocid varchar(64) not null,
  session_qualifier varchar(64) not null,
  msgseqnum integer not null,
  message text not null,
  primary key (beginstring, sendercompid, sendersubid, senderlocid,
               targetcompid, targetsubid, targetlocid, session_qualifier,
               msgseqnum)
);

messages_log

QuickFIX/J 可以将所有入站/出站消息记录到数据库中。从库的角度来看,该表是只写的,因此您是否希望使用该表取决于您。

可以在配置中为入站和出站消息日志指定不同的表。默认情况下,所有消息都记录到一个表中。

create sequence messages_log_sequence;

create table messages_log (
  id integer default nextval('messages_log_sequence'),
  time timestamp not null,
  beginstring char(8) not null,
  sendercompid varchar(64) not null,
  sendersubid varchar(64) not null,
  senderlocid varchar(64) not null,
  targetcompid varchar(64) not null,
  targetsubid varchar(64) not null,
  targetlocid varchar(64) not null,
  session_qualifier varchar(64),
  text text not null,
  primary key (id)
);

event_log

将事件日志写入此表。示例包括:

会话 FIX.4.2:FOO->BAR 时间表为每日,07:00:00-UTC - 21:00:00-UTC

创建会话:FIX.4.2:FOO->BAR

发起登录请求

收到登录

create sequence event_log_sequence;

create table event_log (
  id integer default nextval('event_log_sequence'),
  time timestamp not null,
  beginstring char(8) not null,
  sendercompid varchar(64) not null,
  sendersubid varchar(64) not null,
  senderlocid varchar(64) not null,
  targetcompid varchar(64) not null,
  targetsubid varchar(64) not null,
  targetlocid varchar(64) not null,
  session_qualifier varchar(64),
  text text not null,
  primary key (id)
);

正如@DumbCoder 指出的那样,表名可以通过配置进行自定义。

于 2014-02-24T14:02:17.740 回答