Skip to content

Commit 8fe45d3

Browse files
Merge pull request #352 from hogimn/main
2 parents f582312 + 046ea54 commit 8fe45d3

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

java/EmitLog.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import com.rabbitmq.client.BuiltinExchangeType;
12
import com.rabbitmq.client.Channel;
23
import com.rabbitmq.client.Connection;
34
import com.rabbitmq.client.ConnectionFactory;
@@ -11,7 +12,7 @@ public static void main(String[] argv) throws Exception {
1112
factory.setHost("localhost");
1213
try (Connection connection = factory.newConnection();
1314
Channel channel = connection.createChannel()) {
14-
channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
15+
channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.FANOUT);
1516

1617
String message = argv.length < 1 ? "info: Hello World!" :
1718
String.join(" ", argv);

java/EmitLogTopic.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import com.rabbitmq.client.BuiltinExchangeType;
12
import com.rabbitmq.client.Channel;
23
import com.rabbitmq.client.Connection;
34
import com.rabbitmq.client.ConnectionFactory;
@@ -12,7 +13,7 @@ public static void main(String[] argv) throws Exception {
1213
try (Connection connection = factory.newConnection();
1314
Channel channel = connection.createChannel()) {
1415

15-
channel.exchangeDeclare(EXCHANGE_NAME, "topic");
16+
channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.TOPIC);
1617

1718
String routingKey = getRouting(argv);
1819
String message = getMessage(argv);

java/ReceiveLogs.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import com.rabbitmq.client.Channel;
2-
import com.rabbitmq.client.Connection;
3-
import com.rabbitmq.client.ConnectionFactory;
4-
import com.rabbitmq.client.DeliverCallback;
1+
import com.rabbitmq.client.*;
52

63
public class ReceiveLogs {
74
private static final String EXCHANGE_NAME = "logs";
@@ -12,7 +9,7 @@ public static void main(String[] argv) throws Exception {
129
Connection connection = factory.newConnection();
1310
Channel channel = connection.createChannel();
1411

15-
channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
12+
channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.FANOUT);
1613
String queueName = channel.queueDeclare().getQueue();
1714
channel.queueBind(queueName, EXCHANGE_NAME, "");
1815

java/ReceiveLogsTopic.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import com.rabbitmq.client.Channel;
2-
import com.rabbitmq.client.Connection;
3-
import com.rabbitmq.client.ConnectionFactory;
4-
import com.rabbitmq.client.DeliverCallback;
1+
import com.rabbitmq.client.*;
52

63
public class ReceiveLogsTopic {
74

@@ -13,7 +10,7 @@ public static void main(String[] argv) throws Exception {
1310
Connection connection = factory.newConnection();
1411
Channel channel = connection.createChannel();
1512

16-
channel.exchangeDeclare(EXCHANGE_NAME, "topic");
13+
channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.TOPIC);
1714
String queueName = channel.queueDeclare().getQueue();
1815

1916
if (argv.length < 1) {

0 commit comments

Comments
 (0)