Skip to content

Commit e7a103c

Browse files
committed
Always use 'localhost', avoid setting username and password.
1 parent 1d82921 commit e7a103c

File tree

12 files changed

+16
-22
lines changed

12 files changed

+16
-22
lines changed

java/Recv.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ public static void main(String[] argv) {
88
try {
99
Connection conn = null;
1010
try {
11-
conn = new ConnectionFactory().newConnection();
11+
ConnectionFactory factory = new ConnectionFactory();
12+
factory.setHost("localhost");
13+
conn = factory.newConnection();
1214
Channel chan = conn.createChannel();
1315
chan.queueDeclare("hello", false, false, false, null);
1416
QueueingConsumer consumer = new QueueingConsumer(chan);

java/Send.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ public static void main(String[] argv) {
88
try {
99
Connection conn = null;
1010
try {
11-
conn = new ConnectionFactory().newConnection();
11+
ConnectionFactory factory = new ConnectionFactory();
12+
factory.setHost("localhost");
13+
conn = factory.newConnection();
1214
Channel chan = conn.createChannel();
1315
chan.queueDeclare("hello", false, false, false, null);
1416
chan.basicPublish("", "hello", null, "Hello World!".getBytes());

python/emit_log.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import sys
44

55
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
6-
host='127.0.0.1',
7-
credentials=pika.PlainCredentials('guest', 'guest')))
6+
host='localhost'))
87
channel = connection.channel()
98

109
channel.exchange_declare(exchange='logs',

python/emit_log_direct.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import sys
44

55
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
6-
host='127.0.0.1',
7-
credentials=pika.PlainCredentials('guest', 'guest')))
6+
host='localhost'))
87
channel = connection.channel()
98

109
channel.exchange_declare(exchange='direct_logs',

python/new_task.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import sys
44

55
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
6-
host='127.0.0.1',
7-
credentials=pika.PlainCredentials('guest', 'guest')))
6+
host='localhost'))
87
channel = connection.channel()
98

109
channel.queue_declare(queue='task_queue', durable=True)

python/receive.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import pika
33

44
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
5-
host='127.0.0.1',
6-
credentials=pika.PlainCredentials('guest', 'guest')))
5+
host='localhost'))
76
channel = connection.channel()
87

98

python/receive_logs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import pika
33

44
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
5-
host='127.0.0.1',
6-
credentials=pika.PlainCredentials('guest', 'guest')))
5+
host='localhost'))
76
channel = connection.channel()
87

98
channel.exchange_declare(exchange='logs',

python/receive_logs_direct.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import sys
44

55
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
6-
host='127.0.0.1',
7-
credentials=pika.PlainCredentials('guest', 'guest')))
6+
host='localhost'))
87
channel = connection.channel()
98

109
channel.exchange_declare(exchange='direct_logs',

python/rpc_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
class FibonacciClient(object):
66
def __init__(self):
77
self.connection = pika.AsyncoreConnection(pika.ConnectionParameters(
8-
host='127.0.0.1',
9-
credentials=pika.PlainCredentials('guest', 'guest')))
8+
host='localhost'))
109
self.channel = self.connection.channel()
1110

1211
result = self.channel.queue_declare(auto_delete=True)

python/rpc_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44

55
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
6-
host='127.0.0.1',
7-
credentials=pika.PlainCredentials('guest', 'guest')))
6+
host='localhost'))
87
channel = connection.channel()
98

109

0 commit comments

Comments
 (0)