Tabnine Logo
MessageProperties.getConsumerTag
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: spring-projects/spring-integration

private void addConsumerMetadata(MessageProperties messageProperties, Map<String, Object> headers) {
  String consumerTag = messageProperties.getConsumerTag();
  if (consumerTag != null) {
    headers.put(AmqpHeaders.CONSUMER_TAG, consumerTag);
  }
  String consumerQueue = messageProperties.getConsumerQueue();
  if (consumerQueue != null) {
    headers.put(AmqpHeaders.CONSUMER_QUEUE, consumerQueue);
  }
}
origin: org.springframework.integration/spring-integration-amqp

private void addConsumerMetadata(MessageProperties messageProperties, Map<String, Object> headers) {
  String consumerTag = messageProperties.getConsumerTag();
  if (consumerTag != null) {
    headers.put(AmqpHeaders.CONSUMER_TAG, consumerTag);
  }
  String consumerQueue = messageProperties.getConsumerQueue();
  if (consumerQueue != null) {
    headers.put(AmqpHeaders.CONSUMER_QUEUE, consumerQueue);
  }
}
origin: spring-projects/spring-amqp

/**
 * Determine the name of the listener method that will handle the given message.
 * <p>
 * The default implementation first consults the
 * {@link #setQueueOrTagToMethodName(Map) queueOrTagToMethodName} map looking for a
 * match on the consumer queue or consumer tag; if no match found, it simply returns
 * the configured default listener method, or "handleMessage" if not configured.
 * @param originalMessage the Rabbit request message
 * @param extractedMessage the converted Rabbit request message, to be passed into the
 * listener method as argument
 * @return the name of the listener method (never <code>null</code>)
 * @see #setDefaultListenerMethod
 * @see #setQueueOrTagToMethodName
 */
protected String getListenerMethodName(Message originalMessage, Object extractedMessage) {
  if (this.queueOrTagToMethodName.size() > 0) {
    MessageProperties props = originalMessage.getMessageProperties();
    String methodName = this.queueOrTagToMethodName.get(props.getConsumerQueue());
    if (methodName == null) {
      methodName = this.queueOrTagToMethodName.get(props.getConsumerTag());
    }
    if (methodName != null) {
      return methodName;
    }
  }
  return getDefaultListenerMethod();
}
origin: org.springframework.amqp/spring-rabbit

/**
 * Determine the name of the listener method that will handle the given message.
 * <p>
 * The default implementation first consults the
 * {@link #setQueueOrTagToMethodName(Map) queueOrTagToMethodName} map looking for a
 * match on the consumer queue or consumer tag; if no match found, it simply returns
 * the configured default listener method, or "handleMessage" if not configured.
 * @param originalMessage the Rabbit request message
 * @param extractedMessage the converted Rabbit request message, to be passed into the
 * listener method as argument
 * @return the name of the listener method (never <code>null</code>)
 * @see #setDefaultListenerMethod
 * @see #setQueueOrTagToMethodName
 */
protected String getListenerMethodName(Message originalMessage, Object extractedMessage) {
  if (this.queueOrTagToMethodName.size() > 0) {
    MessageProperties props = originalMessage.getMessageProperties();
    String methodName = this.queueOrTagToMethodName.get(props.getConsumerQueue());
    if (methodName == null) {
      methodName = this.queueOrTagToMethodName.get(props.getConsumerTag());
    }
    if (methodName != null) {
      return methodName;
    }
  }
  return getDefaultListenerMethod();
}
origin: spring-projects/spring-amqp

  headers.put(AmqpHeaders.RECEIVED_USER_ID, userId);
String consumerTag = amqpMessageProperties.getConsumerTag();
if (StringUtils.hasText(consumerTag)) {
  headers.put(AmqpHeaders.CONSUMER_TAG, consumerTag);
origin: spring-projects/spring-amqp

assertTrue(latch.await(5, TimeUnit.SECONDS));
assertEquals(3, messages.size());
assertEquals(consumerTag, messages.get(0).getMessageProperties().getConsumerTag());
assertEquals("foobar", messages.get(0).getMessageProperties().getConsumerQueue());
Executors.newSingleThreadExecutor().execute(() -> container.stop());
org.springframework.amqp.coreMessagePropertiesgetConsumerTag

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

  • Making http post requests using okhttp
  • getSystemService (Context)
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Best IntelliJ 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