Codota Logo
MessageProperties.getAppId
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain MessageProperties
private void myMethod () {
MessageProperties m =
  • Codota Iconnew MessageProperties()
  • Codota IconMessage message;message.getMessageProperties()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-integration

Map<String, Object> headers = new HashMap<String, Object>();
try {
  String appId = amqpMessageProperties.getAppId();
  if (StringUtils.hasText(appId)) {
    headers.put(AmqpHeaders.APP_ID, appId);
origin: spring-projects/spring-integration

assertEquals("test.appId", amqpProperties.getAppId());
assertEquals("test.clusterId", amqpProperties.getClusterId());
assertEquals("test.contentEncoding", amqpProperties.getContentEncoding());
origin: spring-projects/spring-amqp

public MessageBuilderSupport<T> setAppIdIfAbsent(String appId) {
  if (this.properties.getAppId() == null) {
    this.properties.setAppId(appId);
  }
  return this;
}
origin: codeabovelab/haven-platform

@Override
public void report(SortedMap<String, Gauge> gauges,
          SortedMap<String, Counter> counters,
          SortedMap<String, Histogram> histograms,
          SortedMap<String, Meter> meters,
          SortedMap<String, Timer> timers) {
  RabbitTemplate rabbitTemplate = this.templateFuture.get();
  MetricReport report = new MetricReport();
  Map<String, Object> data = new HashMap<>();
  report.setMetrics(data);
  // we note that in MetricRegistry all data persisted into single map, and therefore it's keys unique per registry
  data.putAll(gauges);
  data.putAll(counters);
  data.putAll(histograms);
  data.putAll(meters);
  data.putAll(timers);
  try {
    MessageProperties messageProperties = new MessageProperties();
    processMessageProperties(messageProperties);
    // it's not good, but it simply
    report.setApplication(messageProperties.getAppId());
    report.setApplicationVersion(AppInfo.getApplicationVersion());
    report.setHost((String)messageProperties.getHeaders().get(MessageHeaders.HOST));
    byte[] body = objectMapper.writeValueAsBytes(report);
    Message message = new Message(body, messageProperties);
    rabbitTemplate.send(exchangeName, routingKey, message);
  } catch (JsonProcessingException e) {
    log.error("on serialize metrics report", e);
  }
}
origin: spring-projects/spring-amqp

Map<String, Object> headers = new HashMap<String, Object>();
try {
  String appId = amqpMessageProperties.getAppId();
  if (StringUtils.hasText(appId)) {
    headers.put(AmqpHeaders.APP_ID, appId);
origin: org.springframework.integration/spring-integration-amqp

Map<String, Object> headers = new HashMap<String, Object>();
try {
  String appId = amqpMessageProperties.getAppId();
  if (StringUtils.hasText(appId)) {
    headers.put(AmqpHeaders.APP_ID, appId);
origin: spring-projects/spring-amqp

@Test
public void testWithEncoder() {
  this.applicationContext.getBean(SingleConnectionFactory.class).createConnection().close();
  Logger log = (Logger) LoggerFactory.getLogger("encoded");
  log.info("foo");
  log.info("bar");
  Message received = this.template.receive(this.encodedQueue.getName());
  assertNotNull(received);
  assertThat(new String(received.getBody()), containsString("%d %p %t [%c] - <%m>%n"));
  assertThat(received.getMessageProperties().getAppId(), equalTo("AmqpAppenderTest"));
  assertNotNull(this.template.receive(this.encodedQueue.getName()));
  assertThat(new String(this.template.receive(this.encodedQueue.getName()).getBody()),
      not(containsString("%d %p %t [%c] - <%m>%n")));
}
origin: spring-projects/spring-amqp

assertEquals("test.appId", amqpProperties.getAppId());
assertEquals("test.clusterId", amqpProperties.getClusterId());
assertEquals("test.contentEncoding", amqpProperties.getContentEncoding());
origin: spring-projects/spring-amqp

private void assertLower(MessageProperties properties) {
  assertEquals("appId", properties.getAppId());
  assertEquals("clusterId", properties.getClusterId());
  assertEquals("contentEncoding", properties.getContentEncoding());
  assertEquals(MessageProperties.CONTENT_TYPE_TEXT_PLAIN, properties.getContentType());
  assertEquals(1, properties.getContentLength());
  assertEquals("correlationId", properties.getCorrelationId());
  assertEquals(MessageDeliveryMode.NON_PERSISTENT, properties.getDeliveryMode());
  assertEquals(2, properties.getDeliveryTag());
  assertEquals("expiration", properties.getExpiration());
  assertEquals("bar", properties.getHeaders().get("foo"));
  assertEquals("fiz", properties.getHeaders().get("qux"));
  assertEquals("fuz", properties.getHeaders().get("baz"));
  assertEquals(Integer.valueOf(3), properties.getMessageCount());
  assertEquals("messageId", properties.getMessageId());
  assertEquals(Integer.valueOf(4), properties.getPriority());
  assertEquals("receivedExchange", properties.getReceivedExchange());
  assertEquals("receivedRoutingKey", properties.getReceivedRoutingKey());
  assertTrue(properties.getRedelivered());
  assertTrue(properties.getTimestamp().getTime() > 0);
  assertEquals("type", properties.getType());
  assertEquals("userId", properties.getUserId());
}
origin: spring-projects/spring-amqp

@Override
public BasicProperties fromMessageProperties(final MessageProperties source, final String charset) {
  BasicProperties.Builder target = new BasicProperties.Builder();
  target.headers(this.convertHeadersIfNecessary(source.getHeaders()))
    .timestamp(source.getTimestamp())
    .messageId(source.getMessageId())
    .userId(source.getUserId())
    .appId(source.getAppId())
    .clusterId(source.getClusterId())
    .type(source.getType());
  MessageDeliveryMode deliveryMode = source.getDeliveryMode();
  if (deliveryMode != null) {
    target.deliveryMode(MessageDeliveryMode.toInt(deliveryMode));
  }
  target.expiration(source.getExpiration())
    .priority(source.getPriority())
    .contentType(source.getContentType())
    .contentEncoding(source.getContentEncoding());
  String correlationId = source.getCorrelationId();
  if (StringUtils.hasText(correlationId)) {
    target.correlationId(correlationId);
  }
  String replyTo = source.getReplyTo();
  if (replyTo != null) {
    target.replyTo(replyTo);
  }
  return target.build();
}
origin: org.springframework.amqp/spring-rabbit

@Override
public BasicProperties fromMessageProperties(final MessageProperties source, final String charset) {
  BasicProperties.Builder target = new BasicProperties.Builder();
  target.headers(this.convertHeadersIfNecessary(source.getHeaders()))
    .timestamp(source.getTimestamp())
    .messageId(source.getMessageId())
    .userId(source.getUserId())
    .appId(source.getAppId())
    .clusterId(source.getClusterId())
    .type(source.getType());
  MessageDeliveryMode deliveryMode = source.getDeliveryMode();
  if (deliveryMode != null) {
    target.deliveryMode(MessageDeliveryMode.toInt(deliveryMode));
  }
  target.expiration(source.getExpiration())
    .priority(source.getPriority())
    .contentType(source.getContentType())
    .contentEncoding(source.getContentEncoding());
  String correlationId = source.getCorrelationId();
  if (StringUtils.hasText(correlationId)) {
    target.correlationId(correlationId);
  }
  String replyTo = source.getReplyTo();
  if (replyTo != null) {
    target.replyTo(replyTo);
  }
  return target.build();
}
origin: spring-projects/spring-amqp

private void assertUpper(MessageProperties properties) {
  assertEquals("APPID", properties.getAppId());
  assertEquals("CLUSTERID", properties.getClusterId());
  assertEquals("CONTENTENCODING", properties.getContentEncoding());
  assertEquals(MessageProperties.CONTENT_TYPE_BYTES, properties.getContentType());
  assertEquals(10, properties.getContentLength());
  assertEquals("CORRELATIONID", properties.getCorrelationId());
  assertEquals(MessageDeliveryMode.PERSISTENT, properties.getDeliveryMode());
  assertEquals(20, properties.getDeliveryTag());
  assertEquals("EXPIRATION", properties.getExpiration());
  assertEquals("BAR", properties.getHeaders().get("foo"));
  assertEquals("FIZ", properties.getHeaders().get("qux"));
  assertEquals("FUZ", properties.getHeaders().get("baz"));
  assertEquals(Integer.valueOf(30), properties.getMessageCount());
  assertEquals("MESSAGEID", properties.getMessageId());
  assertEquals(Integer.valueOf(40), properties.getPriority());
  assertEquals("RECEIVEDEXCHANGE", properties.getReceivedExchange());
  assertEquals("RECEIVEDROUTINGKEY", properties.getReceivedRoutingKey());
  assertFalse(properties.getRedelivered());
  assertTrue(properties.getTimestamp().getTime() == 0);
  assertEquals("TYPE", properties.getType());
  assertEquals("USERID", properties.getUserId());
}
org.springframework.amqp.coreMessagePropertiesgetAppId

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

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now