Skip to content

Commit

Permalink
fix(selector): Add requestReply with specific queue
Browse files Browse the repository at this point in the history
  • Loading branch information
maocq committed Jul 31, 2024
1 parent 8cb1e8f commit c1a6281
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public Mono<T> requestReply(MQMessageCreator messageCreator, Duration timeout) {
return sender.send(requestQueue, messageCreator).flatMap(id -> router.wait(id, timeout));
}

public Mono<T> requestReply(Destination destination, MQMessageCreator messageCreator, Duration timeout) {
return sender.send(destination, messageCreator).flatMap(id -> router.wait(id, timeout));
}

private MQMessageCreator defaultCreator(String message) {
return ctx -> {
Message jmsMessage = ctx.createTextMessage(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public Mono<Message> requestReply(MQMessageCreator messageCreator, Duration time
container.get(replyQueue)));
}

public Mono<Message> requestReply(
Destination request, Destination reply, MQMessageCreator messageCreator, Duration timeout) {
return sender.send(request, messageCreator)
.flatMap(id -> listener.getMessageBySelector(selector.buildSelector(id), timeout.toMillis(), reply));
}

private MQMessageCreator defaultCreator(String message) {
return ctx -> {
Message jmsMessage = ctx.createTextMessage(message);
Expand Down

0 comments on commit c1a6281

Please sign in to comment.