Update Recv.java
StandardCharsets.UTF_8 used instead of String value
This commit is contained in:
parent
c033948093
commit
c503a3ad25
@ -17,7 +17,7 @@ public class Recv {
|
||||
System.out.println(" [*] Waiting for messages. To exit press CTRL+C");
|
||||
|
||||
DeliverCallback deliverCallback = (consumerTag, delivery) -> {
|
||||
String message = new String(delivery.getBody(), "UTF-8");
|
||||
String message = new String(delivery.getBody(), StandardCharsets.UTF_8);
|
||||
System.out.println(" [x] Received '" + message + "'");
|
||||
};
|
||||
channel.basicConsume(QUEUE_NAME, true, deliverCallback, consumerTag -> { });
|
||||
|
Loading…
Reference in New Issue
Block a user