Skip to content

Commit 34052d0

Browse files
committed
The queue should be named 'hello' instead of 'test'
1 parent f58bb9c commit 34052d0

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

dotnet/Receive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ static void Main(string[] args) {
1010
IConnection connection = factory.CreateConnection();
1111
IModel channel = connection.CreateModel();
1212

13-
channel.QueueDeclare("test");
13+
channel.QueueDeclare("hello");
1414

1515
QueueingBasicConsumer consumer = new QueueingBasicConsumer(channel);
16-
channel.BasicConsume("test", true, null, consumer);
16+
channel.BasicConsume("hello", true, null, consumer);
1717

1818
Console.WriteLine(" [*] Waiting for messages. To exit press CTRL+C");
1919
while(true) {

dotnet/Send.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ static void Main(string[] args) {
99
IConnection connection = factory.CreateConnection();
1010
IModel channel = connection.CreateModel();
1111

12-
channel.QueueDeclare("test");
12+
channel.QueueDeclare("hello");
1313

1414
string message = "Hello World!";
1515
byte[] body = System.Text.Encoding.UTF8.GetBytes(message);
1616

17-
channel.BasicPublish("", "test", null, body);
17+
channel.BasicPublish("", "hello", null, body);
1818
Console.WriteLine(" [x] Sent {0}", message);
1919

2020
channel.Close();

java/Recv.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public static void main(String[] argv) {
1010
try {
1111
conn = new ConnectionFactory().newConnection();
1212
Channel chan = conn.createChannel();
13-
chan.queueDeclare("test", false, false, false, null);
13+
chan.queueDeclare("hello", false, false, false, null);
1414
QueueingConsumer consumer = new QueueingConsumer(chan);
15-
chan.basicConsume("test", true, consumer);
15+
chan.basicConsume("hello", true, consumer);
1616
while (true) {
1717
QueueingConsumer.Delivery delivery = consumer.nextDelivery();
1818
System.out.println(new String(delivery.getBody()));

java/Send.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public static void main(String[] argv) {
1010
try {
1111
conn = new ConnectionFactory().newConnection();
1212
Channel chan = conn.createChannel();
13-
chan.queueDeclare("test", false, false, false, null);
14-
chan.basicPublish("", "test", null, "Hello World!".getBytes());
13+
chan.queueDeclare("hello", false, false, false, null);
14+
chan.basicPublish("", "hello", null, "Hello World!".getBytes());
1515
}
1616
finally {
1717
if (conn != null) conn.close();

php/receive.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
$channel = $connection->channel();
77

88

9-
$channel->queue_declare('test', false, false, false, false);
9+
$channel->queue_declare('hello', false, false, false, false);
1010

1111
echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
1212

1313
$callback = function($msg) {
1414
echo " [x] Received ", $msg->body, "\n";
1515
};
1616

17-
$channel->basic_consume('test', '', false, true, false, false, $callback);
17+
$channel->basic_consume('hello', '', false, true, false, false, $callback);
1818

1919
while(count($channel->callbacks)) {
2020
$channel->wait();

php/send.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
$channel = $connection->channel();
77

88

9-
$channel->queue_declare('test', false, false, false, false);
9+
$channel->queue_declare('hello', false, false, false, false);
1010

1111
$msg = new AMQPMessage('Hello World!');
12-
$channel->basic_publish($msg, '', 'test');
12+
$channel->basic_publish($msg, '', 'hello');
1313

1414
echo " [x] Sent 'Hello World!'\n";
1515

python/receive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
channel = connection.channel()
88

99

10-
channel.queue_declare(queue='test')
10+
channel.queue_declare(queue='hello')
1111

1212
print ' [*] Waiting for messages. To exit press CTRL+C'
1313

1414
def callback(ch, method, header, body):
1515
print " [x] Received %r" % (body,)
1616

1717
channel.basic_consume(callback,
18-
queue='test',
18+
queue='hello',
1919
no_ack=True)
2020

2121
pika.asyncore_loop()

python/send.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
channel = connection.channel()
88

99

10-
channel.queue_declare(queue='test')
10+
channel.queue_declare(queue='hello')
1111

1212
channel.basic_publish(exchange='',
13-
routing_key='test',
13+
routing_key='hello',
1414
body='Hello World!')
1515
print " [x] Sent 'Hello World!'"
1616

0 commit comments

Comments
 (0)