@Test void receiveMessage_withMimeTypeMessageAttribute_shouldCopyToHeaders() throws Exception { AmazonSQSAsync amazonSqs = mock(AmazonSQSAsync.class); MimeType mimeType = new MimeType("test", "plain", Charset.forName("UTF-8")); when(amazonSqs.receiveMessage(new ReceiveMessageRequest("http: .withWaitTimeSeconds(0).withMaxNumberOfMessages(1) .withAttributeNames(QueueMessageChannel.ATTRIBUTE_NAMES) .withMessageAttributeNames("All"))).thenReturn(new ReceiveMessageResult() .withMessages(new com.amazonaws.services.sqs.model.Message() .withBody("Hello") .withMessageAttributes(Collections.singletonMap( MessageHeaders.CONTENT_TYPE, new MessageAttributeValue() .withDataType( MessageAttributeDataTypes.STRING) .withStringValue(mimeType.toString()))))); PollableChannel messageChannel = new QueueMessageChannel(amazonSqs, "http: Message<?> receivedMessage = messageChannel.receive(); assertThat(receivedMessage.getHeaders().get(MessageHeaders.CONTENT_TYPE)) .isEqualTo(mimeType); }
@Override public Message<String> receive() { return this.receive(0); }
QueueMessageChannel extends AbstractMessageChannel implements PollableChannel { @Override public Message<String> receive() { return this.receive(0); } }
QueueMessageChannel extends AbstractMessageChannel implements PollableChannel { @Override public Message<String> receive() { return this.receive(0); } QueueMessageChannel(AmazonSQSAsync amazonSqs, String queueUrl); }
QueueMessageChannel extends AbstractMessageChannel implements PollableChannel { @Override public Message<String> receive() { return this.receive(0); } QueueMessageChannel(AmazonSQSAsync amazonSqs, String queueUrl); @Override Message<String> receive(); @Override Message<String> receive(long timeout); }
QueueMessageChannel extends AbstractMessageChannel implements PollableChannel { @Override public Message<String> receive() { return this.receive(0); } QueueMessageChannel(AmazonSQSAsync amazonSqs, String queueUrl); @Override Message<String> receive(); @Override Message<String> receive(long timeout);  }