Merge branch 'bladefistx2-patch-1'
This commit is contained in:
commit
73201fb29d
@ -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 + "'");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user