Class AbstractPubSubReader

    • Field Detail

      • context

        protected final Context context
      • project

        protected final java.lang.String project
      • topic

        protected final java.lang.String topic
      • maxAckDeadline

        protected final int maxAckDeadline
      • subscriptionAckDeadline

        protected final int subscriptionAckDeadline
      • subscriptionAutoCreate

        protected final boolean subscriptionAutoCreate
    • Method Detail

      • getPartitions

        public java.util.List<Partition> getPartitions()
      • observeBulk

        public ObserveHandle observeBulk​(@Nullable
                                         java.lang.String name,
                                         Position position,
                                         boolean stopAtCurrent,
                                         CommitLogObserver observer)
        Observe PubSub in a bulk fashion. Note that due to current PubSub implementation the bulk commit must happen before the ack timeout. If the message is not acknowledged before this timeout the message will be redelivered, which will result in duplicate messages.
        Parameters:
        name - name of the observer subscription
        position - must be set to NEWEST
        stopAtCurrent - throw UnsupportedOperationException when true
        observer - the observer of data
        Returns:
        handle to interact with the observation thread
      • parseElements

        protected abstract java.util.List<StreamElement> parseElements​(com.google.pubsub.v1.PubsubMessage m)
      • hasExternalizableOffsets

        public boolean hasExternalizableOffsets()