Class QuickfixjEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.quickfixj.QuickfixjEndpoint
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,QuickfixjEventListener,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.MultipleConsumersSupport,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasId,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.1.0", scheme="quickfix", title="QuickFix", syntax="quickfix:configurationName", category=MESSAGING) public class QuickfixjEndpoint extends org.apache.camel.support.DefaultEndpoint implements QuickfixjEventListener, org.apache.camel.MultipleConsumersSupportOpen a Financial Interchange (FIX) session using an embedded QuickFix/J engine.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_DICTIONARY_KEYstatic StringEVENT_CATEGORY_KEYstatic StringMESSAGE_TYPE_KEYstatic StringSESSION_ID_KEY
-
Constructor Summary
Constructors Constructor Description QuickfixjEndpoint(QuickfixjEngine engine, String uri, org.apache.camel.Component component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConsumer(QuickfixjConsumer consumer)protected voidaddProducer(QuickfixjProducer producer)org.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor)org.apache.camel.ProducercreateProducer()protected voiddoStop()voidensureInitialized()Initializing and starts the engine if it wasn't initialized so far.QuickfixjComponentgetComponent()StringgetConfigurationName()QuickfixjEnginegetEngine()StringgetSessionID()quickfix.SessionIDgetSID()booleanisLazyCreateEngine()booleanisMultipleConsumersSupported()voidonEvent(QuickfixjEventCategory eventCategory, quickfix.SessionID sessionID, quickfix.Message message)protected voidremoveConsumer(QuickfixjConsumer consumer)protected voidremoveProducer(QuickfixjProducer producer)voidsetConfigurationName(String configurationName)Path to the quickfix configuration file.voidsetLazyCreateEngine(boolean lazyCreateEngine)This option allows creating QuickFIX/J engine on demand.voidsetSessionID(String sessionID)The optional sessionID identifies a specific FIX session.-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
EVENT_CATEGORY_KEY
public static final String EVENT_CATEGORY_KEY
- See Also:
- Constant Field Values
-
SESSION_ID_KEY
public static final String SESSION_ID_KEY
- See Also:
- Constant Field Values
-
MESSAGE_TYPE_KEY
public static final String MESSAGE_TYPE_KEY
- See Also:
- Constant Field Values
-
DATA_DICTIONARY_KEY
public static final String DATA_DICTIONARY_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QuickfixjEndpoint
public QuickfixjEndpoint(QuickfixjEngine engine, String uri, org.apache.camel.Component component)
-
-
Method Detail
-
getComponent
public QuickfixjComponent getComponent()
- Overrides:
getComponentin classorg.apache.camel.support.DefaultEndpoint
-
getSessionID
public String getSessionID()
-
getSID
public quickfix.SessionID getSID()
-
setSessionID
public void setSessionID(String sessionID)
The optional sessionID identifies a specific FIX session. The format of the sessionID is: (BeginString):(SenderCompID)[/(SenderSubID)[/(SenderLocationID)]]->(TargetCompID)[/(TargetSubID)[/(TargetLocationID)]]
-
getConfigurationName
public String getConfigurationName()
-
setConfigurationName
public void setConfigurationName(String configurationName)
Path to the quickfix configuration file. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the configuration file using these protocols (classpath is default). ref will lookup the configuration file in the registry. bean will call a method on a bean to be used as the configuration. For bean you can specify the method name after dot, eg bean:myBean.myMethod
-
isLazyCreateEngine
public boolean isLazyCreateEngine()
-
setLazyCreateEngine
public void setLazyCreateEngine(boolean lazyCreateEngine)
This option allows creating QuickFIX/J engine on demand. Value true means the engine is started when first message is send or there's consumer configured in route definition. When false value is used, the engine is started at the endpoint creation. When this parameter is missing, the value of component's property lazyCreateEngines is being used.
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception- Specified by:
createConsumerin interfaceorg.apache.camel.Endpoint- Throws:
Exception
-
createProducer
public org.apache.camel.Producer createProducer() throws Exception- Specified by:
createProducerin interfaceorg.apache.camel.Endpoint- Throws:
Exception
-
addConsumer
protected void addConsumer(QuickfixjConsumer consumer)
-
removeConsumer
protected void removeConsumer(QuickfixjConsumer consumer)
-
addProducer
protected void addProducer(QuickfixjProducer producer)
-
removeProducer
protected void removeProducer(QuickfixjProducer producer)
-
onEvent
public void onEvent(QuickfixjEventCategory eventCategory, quickfix.SessionID sessionID, quickfix.Message message) throws Exception
- Specified by:
onEventin interfaceQuickfixjEventListener- Throws:
Exception
-
isMultipleConsumersSupported
public boolean isMultipleConsumersSupported()
- Specified by:
isMultipleConsumersSupportedin interfaceorg.apache.camel.MultipleConsumersSupport
-
ensureInitialized
public void ensureInitialized() throws ExceptionInitializing and starts the engine if it wasn't initialized so far.- Throws:
Exception
-
getEngine
public QuickfixjEngine getEngine()
-
-