Interface TopicDB

  • All Known Implementing Classes:
    SecuredDbClient, TickDBClient

    @ParametersAreNonnullByDefault
    public interface TopicDB
    TimeBase topics API. Topics are lightweight "Streams". Topics have much less functionality but may provide better latency for some applications. Please note, that most of patterns of interaction with topics assume that you can afford a dedicated CPU core for a thread that publishes data to a topic or reads it from a topic.
    • Method Detail

      • getTopic

        @Nullable
        DirectChannel getTopic​(java.lang.String topicKey)
      • listTopics

        @CheckReturnValue
        java.util.List<java.lang.String> listTopics()
        Returns:
        list of all topic keys
      • createPublisher

        @CheckReturnValue
        deltix.data.stream.MessageChannel<deltix.qsrv.hf.pub.InstrumentMessage> createPublisher​(java.lang.String topicKey,
                                                                                                @Nullable
                                                                                                PublisherPreferences preferences,
                                                                                                @Nullable
                                                                                                IdleStrategy idleStrategy)
                                                                                         throws TopicNotFoundException
        Creates channel for message publishing.
        Parameters:
        topicKey - topic identifier
        preferences - configuration for this publisher
        idleStrategy - strategy to be used when publishing is not possible due to back pressure. If null then determined by preferences.
        Throws:
        TopicNotFoundException
      • createConsumerWorker

        deltix.util.lang.Disposable createConsumerWorker​(java.lang.String topicKey,
                                                         @Nullable
                                                         ConsumerPreferences preferences,
                                                         @Nullable
                                                         IdleStrategy idleStrategy,
                                                         @Nullable
                                                         java.util.concurrent.ThreadFactory threadFactory,
                                                         MessageProcessor processor)
                                                  throws TopicNotFoundException
        Creates worker-style message consumer.
        Parameters:
        topicKey - topic identifier
        preferences - configuration for this consumer
        idleStrategy - strategy to be used when there are no messages to consume. If null then determined by preferences.
        threadFactory - thread factory that will be used to run the processor. If null then default thread factory will be used.
        processor - instance to process arrived messages
        Returns:
        returns a Disposable that can be used to stop message processing
        Throws:
        TopicNotFoundException
      • createConsumer

        @CheckReturnValue
        deltix.data.stream.MessageSource<deltix.qsrv.hf.pub.InstrumentMessage> createConsumer​(java.lang.String topicKey,
                                                                                              @Nullable
                                                                                              ConsumerPreferences preferences,
                                                                                              @Nullable
                                                                                              IdleStrategy idleStrategy)
                                                                                       throws TopicNotFoundException
        Creates MessageSource-style message consumer (blocking).
        Parameters:
        topicKey - topic identifier
        preferences - configuration for this consumer
        idleStrategy - strategy to be used when there are no messages to consume. If null then determined by preferences.
        Returns:
        MessageSource for topic. Calling AbstractCursor.next() will block.
        Throws:
        TopicNotFoundException