public final class FixEngine extends GatewayProcess
Each engine can have one or more associated libraries that manage sessions and perform business logic. These may run in the same JVM process or a different JVM process.
FixLibrary
Modifier and Type | Field and Description |
---|---|
static int |
ENGINE_LIBRARY_ID |
aeron, errorHandler, fixCounters, monitoringAgent, monitoringFile, NO_CONNECTION_ID, NO_CORRELATION_ID
Modifier and Type | Method and Description |
---|---|
java.util.List<FixPSessionInfo> |
allFixPSessions()
Gets session info for all FIXP sessions the FixEngine is aware of including offline ones.
|
java.util.List<SessionInfo> |
allSessions()
Gets session info for all FIX sessions the FixEngine is aware of including offline ones.
|
Reply<?> |
bind()
Binds the acceptor socket to the configured address.
|
void |
close()
Close the engine down, including stopping other running threads.
|
EngineConfiguration |
configuration() |
boolean |
isClosed()
Find out whether the
close() operation has been called. |
static FixEngine |
launch(EngineConfiguration configuration)
Launch the engine.
|
Reply<java.util.List<LibraryInfo>> |
libraries()
Query the engine for the list of libraries currently active.
|
Reply<org.agrona.concurrent.status.ReadablePosition> |
libraryIndexedPosition(int libraryId)
Gets a ReadablePosition that exposes where the Artio indexer has indexed up to for a library id.
|
Reply<java.lang.Long> |
lookupSessionId(java.lang.String localCompId,
java.lang.String remoteCompId,
java.lang.String localSubId,
java.lang.String remoteSubId,
java.lang.String localLocationId,
java.lang.String remoteLocationId)
Gets the session id associated with some combination of id fields.
|
Reply<org.agrona.collections.Long2LongHashMap> |
pruneArchive(org.agrona.collections.Long2LongHashMap recordingIdToMinimumPrunePositions)
Frees up space from the Aeron archive of messages.
|
Reply<?> |
resetSequenceNumber(long sessionId)
Resets the sequence number of a given session.
|
Reply<?> |
resetSessionIds(java.io.File backupLocation)
Deprecated.
|
void |
resetState(java.io.File backupLocation)
This method resets the state of the of the FixEngine that also performs usual end of day processing
operations.
|
protected boolean |
shouldRethrowExceptionInErrorHandler() |
Reply<?> |
unbind()
Unbinds the acceptor socket.
|
Reply<?> |
unbind(boolean endOfDay)
Unbinds the acceptor socket, and optionally starts an end of day
operation if requested.
|
conductorAgent, configureAeronContext, init, initAeron, initMonitoring, initMonitoringAgent
public static final int ENGINE_LIBRARY_ID
public static FixEngine launch(EngineConfiguration configuration)
configuration
- the configuration to use for this engine.public Reply<java.util.List<LibraryInfo>> libraries()
null
then the query hasn't been enqueued and the operation
should be retried on a duty cycle.public Reply<?> unbind()
null
then the query hasn't been enqueued and the operation
should be retried on a duty cycle.public Reply<?> unbind(boolean endOfDay)
null
then the query hasn't been enqueued and the operation
should be retried on a duty cycle.endOfDay
- if currently connected connections need to be logged out and disconnectedpublic Reply<?> bind()
unbind()
previously - launch()
will bind the socket by default.
If the reply is null
then the query hasn't been enqueued and the operation
should be retried on a duty cycle.@Deprecated public Reply<?> resetSessionIds(java.io.File backupLocation)
resetState(File)
method or pruneArchive(Long2LongHashMap)
instead to reset state. This method is Deprecated and may be removed in a future version of Artio.backupLocation
- the location to backup the current session ids file to.
Can be null to indicate that no backup is required.public Reply<?> resetSequenceNumber(long sessionId)
null
then the query hasn't been enqueued and the operation
should be retried on a duty cycle.sessionId
- the id of the session that you want to resetpublic void resetState(java.io.File backupLocation)
backupLocation
- the directory that you wish to copy Artio's session state over to for later inspection.
If this is null no backup of data will be performed. If the directory exists it will be
re-used, if it doesn't it will be created.java.lang.IllegalStateException
- if this FixEngine
hasn't been closed when this method is called.public Reply<org.agrona.concurrent.status.ReadablePosition> libraryIndexedPosition(int libraryId)
libraryId
- the library id of the library that you want to track the position for.public java.util.List<SessionInfo> allSessions()
public java.util.List<FixPSessionInfo> allFixPSessions()
public Reply<java.lang.Long> lookupSessionId(java.lang.String localCompId, java.lang.String remoteCompId, java.lang.String localSubId, java.lang.String remoteSubId, java.lang.String localLocationId, java.lang.String remoteLocationId)
null
then the query hasn't been enqueued and the operation
should be retried on a duty cycle.localCompId
- the senderCompId of messages sent by the gateway on this session.remoteCompId
- the senderCompId of messages received by the gateway on this session.localSubId
- the senderSubId of messages sent by the gateway on this session
or null
if not used in session identification.remoteSubId
- the senderSubId of messages received by the gateway on this session
or null
if not used in session identification.localLocationId
- the senderLocationId of messages sent by the gateway on this session
or null
if not used in session identification.remoteLocationId
- the senderLocationId of messages received by the gateway on this session
or null
if not used in session identification.public void close()
FixLibrary
instances currently live in order for them to gracefully close as well. Therefore if you
close a FixLibrary
before you call this method then the close operation could be delayed by up to
CommonConfiguration.replyTimeoutInMs()
in order for the FixEngine
to timeout the FixLibrary
. In order for graceful shutdown to successfully occur you should also
ensure that any connected FixLibrary
instances are regularly polled on their duty cycle.
This does not remove files associated with the engine, that are persistent over multiple runs of the engine.close
in interface java.lang.AutoCloseable
close
in class GatewayProcess
public boolean isClosed()
close()
operation has been called.close()
operation has been called, false otherwise.public Reply<org.agrona.collections.Long2LongHashMap> pruneArchive(org.agrona.collections.Long2LongHashMap recordingIdToMinimumPrunePositions)
recordingIdToMinimumPrunePositions
- the minimum positions to prune or null
otherwise.
If you're archiving segments of the
Aeron archive log then this parameter can be used in order to stop
those segments from being removed. The hashmap should be initialised
with new Long2LongHashMap(Aeron.NULL_VALUE)
.Aeron.NULL_VALUE
is used to denote
missing values in the map.public EngineConfiguration configuration()
protected boolean shouldRethrowExceptionInErrorHandler()
shouldRethrowExceptionInErrorHandler
in class GatewayProcess
Copyright © 2015-2022 Real Logic Limited. All Rights Reserved.