Tabnine Logo
ConsumerTemplate.receive
Code IndexAdd Tabnine to your IDE (free)

How to use
receive
method
in
org.apache.camel.ConsumerTemplate

Best Java code snippets using org.apache.camel.ConsumerTemplate.receive (Showing top 3 results out of 315)

origin: io.codearte.accurest/accurest-messaging-camel

@Override
@SuppressWarnings("unchecked")
public AccurestMessage<T, Message> receiveMessage(String destination, long timeout, TimeUnit timeUnit) {
  try {
    ConsumerTemplate consumerTemplate = context.createConsumerTemplate();
    Exchange exchange = consumerTemplate.receive(destination, timeUnit.toMillis(timeout));
    return builder.create(exchange.getIn());
  } catch (Exception e) {
    log.error("Exception occurred while trying to read a message from " +
        " a channel with name [" + destination + "]", e);
    throw new RuntimeException(e);
  }
}
origin: com.consol.citrus/citrus-camel

@Override
public Message receive(TestContext context, long timeout) {
  if (log.isDebugEnabled()) {
    log.debug("Receiving message from camel endpoint: '" + endpointConfiguration.getEndpointUri() + "'");
  }
  Exchange exchange = getConsumerTemplate().receive(endpointConfiguration.getEndpointUri(), timeout);
  if (exchange == null) {
    throw new ActionTimeoutException("Action timed out while receiving message from camel endpoint '" + endpointConfiguration.getEndpointUri() + "'");
  }
  log.info("Received message from camel endpoint: '" + endpointConfiguration.getEndpointUri() + "'");
  Message message = endpointConfiguration.getMessageConverter().convertInbound(exchange, endpointConfiguration, context);
  context.onInboundMessage(message);
  return message;
}
origin: com.consol.citrus/citrus-camel

@Override
public Message receive(TestContext context, long timeout) {
  if (log.isDebugEnabled()) {
    log.debug("Receiving message from camel endpoint: '" + endpointConfiguration.getEndpointUri() + "'");
  }
  Exchange exchange = getConsumerTemplate().receive(endpointConfiguration.getEndpointUri(), timeout);
  if (exchange == null) {
    throw new ActionTimeoutException("Action timed out while receiving message from camel endpoint '" + endpointConfiguration.getEndpointUri() + "'");
  }
  log.info("Received message from camel endpoint: '" + endpointConfiguration.getEndpointUri() + "'");
  Message message = endpointConfiguration.getMessageConverter().convertInbound(exchange, endpointConfiguration, context);
  context.onInboundMessage(message);
  String correlationKeyName = endpointConfiguration.getCorrelator().getCorrelationKeyName(getName());
  String correlationKey = endpointConfiguration.getCorrelator().getCorrelationKey(message);
  correlationManager.saveCorrelationKey(correlationKeyName, correlationKey, context);
  correlationManager.store(correlationKey, exchange);
  return message;
}
org.apache.camelConsumerTemplatereceive

Popular methods of ConsumerTemplate

  • receiveBody
  • stop
  • start
  • doneUoW

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • JFileChooser (javax.swing)
  • Top PhpStorm plugins
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