Tabnine Logo
MessageDispatcher.accept
Code IndexAdd Tabnine to your IDE (free)

How to use
accept
method
in
de.otto.synapse.consumer.MessageDispatcher

Best Java code snippets using de.otto.synapse.consumer.MessageDispatcher.accept (Showing top 4 results out of 315)

origin: de.otto.synapse/synapse-core

private CompletableFuture<ChannelPosition> consumeMessageStore() {
  final ThreadFactory threadFactory = new CustomizableThreadFactory("synapse-eventsource-");
  return CompletableFuture.supplyAsync(() -> {
    messageStore.stream().forEach(message -> {
      final Message<String> interceptedMessage = getMessageLogReceiverEndpoint().getInterceptorChain().intercept(message);
      if (interceptedMessage != null) {
        getMessageLogReceiverEndpoint().getMessageDispatcher().accept(interceptedMessage);
      }
    });
    return messageStore.getLatestChannelPosition();
  }, newSingleThreadExecutor(threadFactory));
}
origin: de.otto.synapse/synapse-testsupport

final Message<String> interceptedMessage = intercept(receivedMessage);
if (interceptedMessage != null) {
  getMessageDispatcher().accept(interceptedMessage);
origin: de.otto.synapse/synapse-testsupport

getMessageDispatcher().accept(interceptedMessage);
origin: de.otto.synapse/synapse-aws-kinesis

@Override
public void accept(final ShardResponse response) {
  final InterceptorChain interceptorChain = interceptorRegistry.getInterceptorChain(channelName, RECEIVER);
  response.getMessages().forEach(message -> {
    try {
      final Message<String> interceptedMessage = interceptorChain.intercept(message);
      if (interceptedMessage != null) {
        messageDispatcher.accept(interceptedMessage);
      }
    } catch (final Exception e) {
      LOG.error("Error processing message: " + e.getMessage(), e);
    }
  });
  channelDurationBehind.updateAndGet(behind -> copyOf(behind)
      .with(response.getShardName(), response.getDurationBehind())
      .build());
  if (eventPublisher != null) {
    eventPublisher.publishEvent(builder()
        .withChannelName(channelName)
        .withChannelDurationBehind(channelDurationBehind.get())
        .withStatus(RUNNING)
        .withMessage("Reading from kinesis shard.")
        .build());
  }
}
de.otto.synapse.consumerMessageDispatcheraccept

Javadoc

Accepts a message with JSON String payload, dispatches this method to the different registered MessageConsumer if their MessageConsumer#keyPattern() matches, and translates the JSON payload into the expected MessageConsumer#payloadType() of the receiving MessageConsumer.

Popular methods of MessageDispatcher

  • <init>
  • add
  • matchesKeyPattern

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • From CI to AI: The AI layer in your organization
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