Last week I was building up a RabbitMQ cluster with shovel from New York to Los Angeles. As we use a dual stack environment ipv4/v6, I expected that RabbitMQ would resolve the ipv6 address first as normal Linux systems do. So I begun to do my tests and realized, that it didn’t.
My publisher (see code below) sends messages to the following host: “‘rabbitmq0.domb.net‘”
import sys
conn = amqp.Connection('rabbitmq0.domb.net', userid="logger", password="test", virtual_host="/", insist=False)
chan = conn.channel()
for i in range(1000):
#msg = amqp.Message(sys.argv[1])
sendmsg = "paket ny:" + str(i)
msg = amqp.Message(sendmsg)
msg.properties["delivery_mode"] = 2
chan.basic_publish(msg,exchange="incoming_orders",routing_key="warehouse")
chan.close()
conn.close()
Executing that code I got the following error:
{rabbit_shovel_worker,handle_cast,2},
{gen_server2,handle_msg,2},
{proc_lib,init_p_do_apply,3}]}
Here an example with a ipv6 address:
import sys
conn = amqp.Connection('[2625:103:2012::205a]:5672', userid="logger", password="test", virtual_host="/", insist=False)
chan = conn.channel()
for i in range(1000):
#msg = amqp.Message(sys.argv[1])
sendmsg = "paket ny:" + str(i)
msg = amqp.Message(sendmsg)
msg.properties["delivery_mode"] = 2
chan.basic_publish(msg,exchange="incoming_orders",routing_key="warehouse")
chan.close()
conn.close()
Yes it does.
As I need ipv6 and couldn’t find the code where the erlang parameter gets passed I wrote to the RabbitMQ mailing list.
http://comments.gmane.org/gmane.comp.networking.rabbitmq.general/18437
And got a fast response and a fix from Emile Joubert from rabbitmq 4 days later. Thank you very much!!! Will test the patch this week.
Here is the patch
http://hg.rabbitmq.com/rabbitmq-erlang-client/rev/7f53561c0c11
If you don’t know howto rebuild the rpm you can have mine until the official comes out. Use it at your own risk!