@Test void receiveMessage_withIdOfTypeString_IdShouldBeConvertedToUuid() throws Exception { AmazonSQSAsync amazonSqs = mock(AmazonSQSAsync.class); UUID uuid = UUID.randomUUID(); 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.ID, new MessageAttributeValue() .withDataType( MessageAttributeDataTypes.STRING) .withStringValue(uuid.toString()))))); PollableChannel messageChannel = new QueueMessageChannel(amazonSqs, "http: Message<?> receivedMessage = messageChannel.receive(); Object idMessageHeader = receivedMessage.getHeaders().get(MessageHeaders.ID); assertThat(UUID.class.isInstance(idMessageHeader)).isTrue(); assertThat(idMessageHeader).isEqualTo(uuid); }
@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);  }