Skip to content

Commit d026504

Browse files
Merge pull request #117 from monosoul/updated-tutorial-six-java
Added back forgotten correlation id check
2 parents 557e5c0 + 498b899 commit d026504

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/RPCClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public String call(String message) throws IOException, InterruptedException {
4444
channel.basicConsume(replyQueueName, true, new DefaultConsumer(channel) {
4545
@Override
4646
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
47-
response.offer(new String(body, "UTF-8"));
47+
if (properties.getCorrelationId().equals(corrId)) {
48+
response.offer(new String(body, "UTF-8"));
49+
}
4850
}
4951
});
5052

0 commit comments

Comments
 (0)