Merge branch 'bladefistx2-patch-1'

This commit is contained in:
Michael Klishin 2019-11-14 19:16:44 +03:00
commit 73201fb29d
No known key found for this signature in database
GPG Key ID: E80EDCFA0CDB21EE

View File

@ -2,6 +2,8 @@ import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import java.nio.charset.StandardCharsets;
public class Send {
private final static String QUEUE_NAME = "hello";
@ -13,7 +15,7 @@ public class Send {
Channel channel = connection.createChannel()) {
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
String message = "Hello World!";
channel.basicPublish("", QUEUE_NAME, null, message.getBytes("UTF-8"));
channel.basicPublish("", QUEUE_NAME, null, message.getBytes(StandardCharsets.UTF_8));
System.out.println(" [x] Sent '" + message + "'");
}
}