Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

The queue should be named 'hello' instead of 'test'

  • Loading branch information...
commit 34052d0eeb1743bf7b4a0f65033a4a1bde2ef2dc 1 parent f58bb9c
@majek majek authored
View
4 dotnet/Receive.cs
@@ -10,10 +10,10 @@ class Program {
IConnection connection = factory.CreateConnection();
IModel channel = connection.CreateModel();
- channel.QueueDeclare("test");
+ channel.QueueDeclare("hello");
QueueingBasicConsumer consumer = new QueueingBasicConsumer(channel);
- channel.BasicConsume("test", true, null, consumer);
+ channel.BasicConsume("hello", true, null, consumer);
Console.WriteLine(" [*] Waiting for messages. To exit press CTRL+C");
while(true) {
View
4 dotnet/Send.cs
@@ -9,12 +9,12 @@ class Program {
IConnection connection = factory.CreateConnection();
IModel channel = connection.CreateModel();
- channel.QueueDeclare("test");
+ channel.QueueDeclare("hello");
string message = "Hello World!";
byte[] body = System.Text.Encoding.UTF8.GetBytes(message);
- channel.BasicPublish("", "test", null, body);
+ channel.BasicPublish("", "hello", null, body);
Console.WriteLine(" [x] Sent {0}", message);
channel.Close();
View
4 java/Recv.java
@@ -10,9 +10,9 @@ public static void main(String[] argv) {
try {
conn = new ConnectionFactory().newConnection();
Channel chan = conn.createChannel();
- chan.queueDeclare("test", false, false, false, null);
+ chan.queueDeclare("hello", false, false, false, null);
QueueingConsumer consumer = new QueueingConsumer(chan);
- chan.basicConsume("test", true, consumer);
+ chan.basicConsume("hello", true, consumer);
while (true) {
QueueingConsumer.Delivery delivery = consumer.nextDelivery();
System.out.println(new String(delivery.getBody()));
View
4 java/Send.java
@@ -10,8 +10,8 @@ public static void main(String[] argv) {
try {
conn = new ConnectionFactory().newConnection();
Channel chan = conn.createChannel();
- chan.queueDeclare("test", false, false, false, null);
- chan.basicPublish("", "test", null, "Hello World!".getBytes());
+ chan.queueDeclare("hello", false, false, false, null);
+ chan.basicPublish("", "hello", null, "Hello World!".getBytes());
}
finally {
if (conn != null) conn.close();
View
4 php/receive.php
@@ -6,7 +6,7 @@
$channel = $connection->channel();
-$channel->queue_declare('test', false, false, false, false);
+$channel->queue_declare('hello', false, false, false, false);
echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
@@ -14,7 +14,7 @@
echo " [x] Received ", $msg->body, "\n";
};
-$channel->basic_consume('test', '', false, true, false, false, $callback);
+$channel->basic_consume('hello', '', false, true, false, false, $callback);
while(count($channel->callbacks)) {
$channel->wait();
View
4 php/send.php
@@ -6,10 +6,10 @@
$channel = $connection->channel();
-$channel->queue_declare('test', false, false, false, false);
+$channel->queue_declare('hello', false, false, false, false);
$msg = new AMQPMessage('Hello World!');
-$channel->basic_publish($msg, '', 'test');
+$channel->basic_publish($msg, '', 'hello');
echo " [x] Sent 'Hello World!'\n";
View
4 python/receive.py
@@ -7,7 +7,7 @@
channel = connection.channel()
-channel.queue_declare(queue='test')
+channel.queue_declare(queue='hello')
print ' [*] Waiting for messages. To exit press CTRL+C'
@@ -15,7 +15,7 @@ def callback(ch, method, header, body):
print " [x] Received %r" % (body,)
channel.basic_consume(callback,
- queue='test',
+ queue='hello',
no_ack=True)
pika.asyncore_loop()
View
4 python/send.py
@@ -7,10 +7,10 @@
channel = connection.channel()
-channel.queue_declare(queue='test')
+channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
- routing_key='test',
+ routing_key='hello',
body='Hello World!')
print " [x] Sent 'Hello World!'"
Please sign in to comment.
Something went wrong with that request. Please try again.