Tabnine Logo
BatchingEventStorageEngine.readEvents
Code IndexAdd Tabnine to your IDE (free)

How to use
readEvents
method
in
org.axonframework.eventsourcing.eventstore.BatchingEventStorageEngine

Best Java code snippets using org.axonframework.eventsourcing.eventstore.BatchingEventStorageEngine.readEvents (Showing top 2 results out of 315)

origin: AxonFramework/AxonFramework

@Test
@SuppressWarnings("OptionalGetWithoutIsPresent")
public void testLoad_LargeAmountOfEvents() {
  int eventCount = testSubject.batchSize() + 10;
  testSubject.appendEvents(createEvents(eventCount));
  assertEquals(eventCount, testSubject.readEvents(AGGREGATE).asStream().count());
  assertEquals(eventCount - 1,
         testSubject.readEvents(AGGREGATE).asStream().reduce((a, b) -> b).get().getSequenceNumber());
}
origin: AxonFramework/AxonFramework

  private List<TrackedEventMessage<?>> readEvents(int eventCount) {
    List<TrackedEventMessage<?>> result = new ArrayList<>();
    TrackingToken lastToken = null;
    while (result.size() < eventCount) {
      List<? extends TrackedEventMessage<?>> batch =
          testSubject.readEvents(lastToken, false).collect(Collectors.toList());
      for (TrackedEventMessage<?> message : batch) {
        result.add(message);
        if (logger.isDebugEnabled()) {
          logger.debug(message.getPayload() + " / " + ((DomainEventMessage<?>) message).getSequenceNumber() +
                     " => " + message.trackingToken().toString());
        }
        lastToken = message.trackingToken();
      }
    }
    return result;
  }
}
org.axonframework.eventsourcing.eventstoreBatchingEventStorageEnginereadEvents

Popular methods of BatchingEventStorageEngine

  • appendEvents
  • fetchDomainEvents
    Returns a batch of events published by an aggregate with given aggregateIdentifier. The sequence num
  • fetchForAggregateUntilEmpty
    Specifies whether the #readEventData(String,long) should proceed fetching events for an aggregate un
  • fetchTrackedEvents
    Returns a batch of serialized event data entries in the event storage that have a TrackingToken grea
  • batchSize
    Returns the maximum number of event entries to be fetched per batch.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now