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

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

Best Java code snippets using org.springframework.amqp.core.MessageProperties.getType (Showing top 13 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

  headers.put(AmqpHeaders.TIMESTAMP, timestamp);
String type = amqpMessageProperties.getType();
if (StringUtils.hasText(type)) {
  headers.put(AmqpHeaders.TYPE, type);
origin: spring-projects/spring-integration

assertEquals("test.replyTo", amqpProperties.getReplyTo());
assertEquals(testTimestamp, amqpProperties.getTimestamp());
assertEquals("test.type", amqpProperties.getType());
assertEquals("test.userId", amqpProperties.getUserId());
origin: spring-projects/spring-amqp

public MessageBuilderSupport<T> setTypeIfAbsent(String type) {
  if (this.properties.getType() == null) {
    this.properties.setType(type);
  }
  return this;
}
origin: spring-projects/spring-amqp

  headers.put(AmqpHeaders.TIMESTAMP, timestamp);
String type = amqpMessageProperties.getType();
if (StringUtils.hasText(type)) {
  headers.put(AmqpHeaders.TYPE, type);
origin: org.springframework.integration/spring-integration-amqp

  headers.put(AmqpHeaders.TIMESTAMP, timestamp);
String type = amqpMessageProperties.getType();
if (StringUtils.hasText(type)) {
  headers.put(AmqpHeaders.TYPE, type);
origin: Bluelock/camel-spring-amqp

public static SpringAMQPMessage setBasicPropertiesToHeaders(SpringAMQPMessage msg, Message amqpMessage) {
  msg.getHeaders().put(MESSAGE_ID, amqpMessage.getMessageProperties().getMessageId());
  byte[] correlationId = amqpMessage.getMessageProperties().getCorrelationId();
  msg.getHeaders().put(CORRELATION_ID, correlationId == null ? null : new String(correlationId));
  msg.getHeaders().put(CONTENT_ENCODING, amqpMessage.getMessageProperties().getContentEncoding());
  msg.getHeaders().put(CONTENT_TYPE, amqpMessage.getMessageProperties().getContentType());
  msg.getHeaders().put(EXPIRATION, amqpMessage.getMessageProperties().getExpiration());
  msg.getHeaders().put(PRIORITY, amqpMessage.getMessageProperties().getPriority());
  msg.getHeaders().put(REPLY_TO, amqpMessage.getMessageProperties().getReplyTo());
  msg.getHeaders().put(DELIVERY_MODE, MessageDeliveryMode.toInt(amqpMessage.getMessageProperties().getDeliveryMode()));
  msg.getHeaders().put(TYPE, amqpMessage.getMessageProperties().getType());
  return msg;
}

origin: com.bluelock/camel-spring-amqp

public static SpringAMQPMessage setBasicPropertiesToHeaders(SpringAMQPMessage msg, Message amqpMessage) {
  msg.getHeaders().put(MESSAGE_ID, amqpMessage.getMessageProperties().getMessageId());
  byte[] correlationId = amqpMessage.getMessageProperties().getCorrelationId();
  msg.getHeaders().put(CORRELATION_ID, correlationId == null ? null : new String(correlationId));
  msg.getHeaders().put(CONTENT_ENCODING, amqpMessage.getMessageProperties().getContentEncoding());
  msg.getHeaders().put(CONTENT_TYPE, amqpMessage.getMessageProperties().getContentType());
  msg.getHeaders().put(EXPIRATION, amqpMessage.getMessageProperties().getExpiration());
  msg.getHeaders().put(PRIORITY, amqpMessage.getMessageProperties().getPriority());
  msg.getHeaders().put(REPLY_TO, amqpMessage.getMessageProperties().getReplyTo());
  msg.getHeaders().put(DELIVERY_MODE, MessageDeliveryMode.toInt(amqpMessage.getMessageProperties().getDeliveryMode()));
  msg.getHeaders().put(TYPE, amqpMessage.getMessageProperties().getType());
  return msg;
}

origin: spring-projects/spring-amqp

assertEquals("test.replyTo", amqpProperties.getReplyTo());
assertEquals(testTimestamp, amqpProperties.getTimestamp());
assertEquals("test.type", amqpProperties.getType());
assertEquals("test.userId", amqpProperties.getUserId());
assertEquals(Integer.valueOf(1234), amqpProperties.getDelay());
origin: spring-projects/spring-amqp

@Test
public void buildMessageWithStandardMessage() throws Exception {
  Message<String> result = MessageBuilder.withPayload("Response")
      .setHeader("foo", "bar")
      .setHeader(AmqpHeaders.TYPE, "msg_type")
      .setHeader(AmqpHeaders.REPLY_TO, "reply")
      .build();
  Channel session = mock(Channel.class);
  MessagingMessageListenerAdapter listener = getSimpleInstance("echo", Message.class);
  org.springframework.amqp.core.Message replyMessage = listener.buildMessage(session, result, null);
  assertNotNull("reply should never be null", replyMessage);
  assertEquals("Response", new String(replyMessage.getBody()));
  assertEquals("type header not copied", "msg_type", replyMessage.getMessageProperties().getType());
  assertEquals("replyTo header not copied", "reply", replyMessage.getMessageProperties().getReplyTo());
  assertEquals("custom header not copied", "bar", replyMessage.getMessageProperties().getHeaders().get("foo"));
}
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.coreMessagePropertiesgetType

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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getContentResolver (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • JOptionPane (javax.swing)
  • 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