-
Interface Summary
Interface |
Description |
MessageByIdGet |
withOrderAndReturnInfo(client(), ((order, returnInfo) -> {
//query one message since message creation is not directly possible
final MessageQuery query = MessageQuery.of()
.withPredicates(m -> m.type().is("ReturnInfoAdded"))
.withSort(m -> m.createdAt().sort().desc())
.withLimit(1L);
assertEventually(Duration.ofSeconds(45), Duration.ofMillis(100), () -> {
final Optional<Message> messageOptional = client().executeBlocking(query).head();
assertThat(messageOptional).isPresent();
final Message messageFromQueryEndpoint = messageOptional.get();
final Message message = client().executeBlocking(MessageByIdGet.of(messageFromQueryEndpoint));
assertThat(message).isEqualTo(messageFromQueryEndpoint);
});
return order;
}));
See the test code.
If you need to receive one specific message class, like DeliveryAddedMessage ,
use MessageQuery with a predicate by id.
|
MessageQuery |
Provides a QueryDsl for messages to formulate predicates, search expressions and reference expansion path expressions. For further information how to use the query API to consult the Query API documentation.
Query for any message
|
MessageQueryModel |
|
MessageTypeQueryModel |
|
-
Package io.sphere.sdk.messages.queries Description
Provides types to retrieve the state of messages.