Skip to content

Commit

Permalink
The queue should be named 'hello' instead of 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Nov 30, 2010
1 parent f58bb9c commit 34052d0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dotnet/Receive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ static void Main(string[] args) {
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) {
Expand Down
4 changes: 2 additions & 2 deletions dotnet/Send.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ static void Main(string[] args) {
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();
Expand Down
4 changes: 2 additions & 2 deletions java/Recv.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
4 changes: 2 additions & 2 deletions java/Send.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions php/receive.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
$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";

$callback = function($msg) {
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();
Expand Down
4 changes: 2 additions & 2 deletions php/send.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 2 additions & 2 deletions python/receive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
channel = connection.channel()


channel.queue_declare(queue='test')
channel.queue_declare(queue='hello')

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

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()
4 changes: 2 additions & 2 deletions python/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!'"

0 comments on commit 34052d0

Please sign in to comment.