praekeltfoundation / vumi

Messaging engine for the delivery of SMS, Star Menu and chat messages to diverse audiences in emerging markets and beyond.
BSD 3-Clause "New" or "Revised" License
420 stars 131 forks source link

Encoding of routing_key when creating Publisher or Consumer #230

Open overnin opened 12 years ago

overnin commented 12 years ago

When creating a Publisher or a Consumer, the routing key has to be encoded as string. There is no validation on how this value in encoded which can throw an error when the routing_key is in unicode.

This issue can happen when dynamically modifying the configuration of vumi elements (worker, dispatcher or transport) via RabbitMQ message. Indeed RabbitMQ is encoding all the message key/value in unicode.

Use case: A new worker is dynamically created by a multiworker, the transport_name=xmpp of this new worker is send to the multiworker via RabbitMQ. Then the multiworker is creating the worker and is passing his transport_name. Finally, the worker throw an exception as it is creating his Publisher with the "xmpp" in unicode.

smn commented 12 years ago

@overnin thanks for this.

Dynamically starting workers based on received AMQP messages is something we've looked at doing for a while. Is this something you are already implementing / using? Would love to learn from your work if at all possible.

overnin commented 12 years ago

Yep, there are dynamic stuff that i'd like to share next week:

hodgestar commented 11 years ago

@overnin Any word on this?