congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
MessageProperties.setCorrelationIdString
Code IndexAdd Tabnine to your IDE (free)

How to use
setCorrelationIdString
method
in
org.springframework.amqp.core.MessageProperties

Best Java code snippets using org.springframework.amqp.core.MessageProperties.setCorrelationIdString (Showing top 5 results out of 315)

origin: com.dell.cpsd.common.messaging/common-rabbitmq

/**
 * This makes a <code>MessageProperties</code> with the specified properties.
 *
 * @param timestamp     The timestamp.
 * @param correlationId The correlation identifier.
 * @param replyTo       The reply to destination.
 * @since 1.0
 */
public static MessageProperties makeMessageProperties(final Date timestamp, final String correlationId, final String replyTo)
{
  final MessageProperties messageProperties = new MessageProperties();
  messageProperties.setTimestamp(timestamp);
  messageProperties.setCorrelationIdString(correlationId);
  if (correlationId != null)
  {
    try
    {
      messageProperties.setCorrelationId(correlationId.getBytes("UTF-8"));
    }
    catch (UnsupportedEncodingException exception)
    {
    }
  }
  messageProperties.setReplyTo(replyTo);
  return messageProperties;
}
origin: com.dell.cpsd/common-rabbitmq

/**
 * This makes a <code>MessageProperties</code> with the specified properties.
 *
 * @param timestamp     The timestamp.
 * @param correlationId The correlation identifier.
 * @param replyTo       The reply to destination.
 * @since 1.0
 */
public static MessageProperties makeMessageProperties(final Date timestamp, final String correlationId, final String replyTo)
{
  final MessageProperties messageProperties = new MessageProperties();
  messageProperties.setTimestamp(timestamp);
  messageProperties.setCorrelationIdString(correlationId);
  if (correlationId != null)
  {
    try
    {
      messageProperties.setCorrelationId(correlationId.getBytes("UTF-8"));
    }
    catch (UnsupportedEncodingException exception)
    {
    }
  }
  messageProperties.setReplyTo(replyTo);
  return messageProperties;
}
origin: societe-generale/rabbitmq-advanced-spring-boot-starter

@Override
public void recover(final Message message, final Throwable cause) {
 Map<String, Object> headers = message.getMessageProperties().getHeaders();
 headers.put("x-exception-stacktrace", ExceptionUtils.getFullStackTrace(cause));
 headers.put("x-exception-message", ExceptionUtils.getMessage(cause));
 headers.put("x-exception-root-cause-message", ExceptionUtils.getRootCauseMessage(cause));
 headers.put("x-original-exchange", message.getMessageProperties().getReceivedExchange());
 headers.put("x-original-routingKey", message.getMessageProperties().getReceivedRoutingKey());
 headers.put("x-original-queue", message.getMessageProperties().getConsumerQueue());
 headers.put("x-recover-time", new Date().toString());
 String deadLetterExchangeName = rabbitmqProperties.getDeadLetterConfig().getDeadLetterExchange().getName();
 String deadLetterRoutingKey = rabbitmqProperties.getDeadLetterConfig().createDeadLetterQueueName(message.getMessageProperties().getConsumerQueue());
 headers.put("x-dead-letter-exchange", deadLetterExchangeName);
 headers.put("x-dead-letter-queue", deadLetterRoutingKey);
 if(headers.containsKey("correlation-id")) {
  message.getMessageProperties().setCorrelationIdString((String) headers.get("correlation-id"));
 }
 headers.putAll(loadAdditionalHeaders(message, cause));
 for (MessageExceptionHandler messageExceptionHandler : messageExceptionHandlers) {
  try {
   messageExceptionHandler.handle(message, cause);
  } catch (Exception e) {
   // To catch any exception in the  MessageExceptionHandler to avoid the interruption in other MessageExceptionHandlers
   log.error("Exception occurred while processing '{}' message exception handler.", messageExceptionHandler, e);
  }
 }
 this.errorTemplate.send(deadLetterExchangeName, deadLetterRoutingKey, message);
 log.warn("Republishing failed message to exchange '{}', routing key '{}', message {{}} , cause {}",
     deadLetterExchangeName, deadLetterRoutingKey, message, cause);
}
origin: com.dell.cpsd.common.messaging/common-rabbitmq

  /**
   * {@inheritDoc}
   */
  @Override
  public Message postProcessMessage(final Message message) throws AmqpException
  {
    if (message == null)
    {
      return message;
    }

    final MessageProperties messageProperties = message.getMessageProperties();

    messageProperties.setTimestamp(this.properties.getTimestamp());

    final byte[] correlationId = this.properties.getCorrelationId();
    messageProperties.setCorrelationId(correlationId);

    messageProperties.setCorrelationIdString(this.properties.getCorrelationIdString());

    messageProperties.setReplyTo(this.properties.getReplyTo());
    messageProperties.setExpiration(this.properties.getExpiration());

    return message;
  }
}
origin: com.dell.cpsd/common-rabbitmq

  /**
   * {@inheritDoc}
   */
  @Override
  public Message postProcessMessage(final Message message) throws AmqpException
  {
    if (message == null)
    {
      return message;
    }

    final MessageProperties messageProperties = message.getMessageProperties();

    messageProperties.setTimestamp(this.properties.getTimestamp());

    final byte[] correlationId = this.properties.getCorrelationId();
    messageProperties.setCorrelationId(correlationId);

    messageProperties.setCorrelationIdString(this.properties.getCorrelationIdString());

    messageProperties.setReplyTo(this.properties.getReplyTo());
    messageProperties.setExpiration(this.properties.getExpiration());

    return message;
  }
}
org.springframework.amqp.coreMessagePropertiessetCorrelationIdString

Popular methods of MessageProperties

  • getDeliveryTag
  • <init>
  • setHeader
  • getHeaders
  • setExpiration
  • setContentType
  • getReplyTo
  • getCorrelationId
  • getMessageId
  • getReceivedRoutingKey
  • setCorrelationId
  • setDeliveryMode
  • setCorrelationId,
  • setDeliveryMode,
  • setReplyTo,
  • getConsumerQueue,
  • getReceivedExchange,
  • getContentType,
  • getExpiration,
  • setContentEncoding,
  • setMessageId,
  • getAppId

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • notifyDataSetChanged (ArrayAdapter)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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