Class 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,
                 headersClass=QuickfixjEndpoint.class)
    public class QuickfixjEndpoint
    extends org.apache.camel.support.DefaultEndpoint
    implements QuickfixjEventListener, org.apache.camel.MultipleConsumersSupport
    Open a Financial Interchange (FIX) session using an embedded QuickFix/J engine.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addConsumer​(QuickfixjConsumer consumer)  
      protected void addProducer()  
      org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Producer createProducer()  
      protected void doStop()  
      void ensureInitialized()
      Initializing and starts the engine if it wasn't initialized so far.
      QuickfixjComponent getComponent()  
      String getConfigurationName()  
      QuickfixjEngine getEngine()  
      String getSessionID()  
      quickfix.SessionID getSID()  
      boolean isLazyCreateEngine()  
      boolean isMultipleConsumersSupported()  
      void onEvent​(QuickfixjEventCategory eventCategory, quickfix.SessionID sessionID, quickfix.Message message)  
      protected void removeConsumer​(QuickfixjConsumer consumer)  
      protected void removeProducer()  
      void setConfigurationName​(String configurationName)
      Path to the quickfix configuration file.
      void setLazyCreateEngine​(boolean lazyCreateEngine)
      This option allows creating QuickFIX/J engine on demand.
      void setSessionID​(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 interface org.apache.camel.Endpoint

        getEndpointBaseUri, isSingletonProducer
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Field Detail

      • EVENT_CATEGORY_KEY

        @Metadata(description="The event category.",
                  javaType="org.apache.camel.component.quickfixj.QuickfixjEventCategory")
        public static final String EVENT_CATEGORY_KEY
        See Also:
        Constant Field Values
      • SESSION_ID_KEY

        @Metadata(description="The FIX message SessionID.",
                  javaType="quickfix.SessionID")
        public static final String SESSION_ID_KEY
        See Also:
        Constant Field Values
      • MESSAGE_TYPE_KEY

        @Metadata(description="The FIX MsgType tag value.",
                  javaType="String")
        public static final String MESSAGE_TYPE_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:
        getComponent in class org.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:
        createConsumer in interface org.apache.camel.Endpoint
        Throws:
        Exception
      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Specified by:
        createProducer in interface org.apache.camel.Endpoint
        Throws:
        Exception
      • addProducer

        protected void addProducer()
      • removeProducer

        protected void removeProducer()
      • isMultipleConsumersSupported

        public boolean isMultipleConsumersSupported()
        Specified by:
        isMultipleConsumersSupported in interface org.apache.camel.MultipleConsumersSupport
      • ensureInitialized

        public void ensureInitialized()
                               throws Exception
        Initializing and starts the engine if it wasn't initialized so far.
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.DefaultEndpoint
        Throws:
        Exception