def publish_to(exname, message, opts={})
      EventMachine.schedule {
        ex = amq.exchanges[exname] || raise("Undefined exchange name : #{exname}")
        case ex.type
        when :topic
          unless opts.has_key? :key
            opts[:key] = '*'
          end
        end
        ex.publish(Serializer.instance.marshal(message), opts)
      }
    end
def publish_to(exname, message, opts={})
      EventMachine.schedule {
        ex = amq.exchanges[exname] || raise("Undefined exchange name : #{exname}")
        case ex.type
        when :topic
          unless opts.has_key? :key
            opts[:key] = '*'
          end
        end
        ex.publish(Serializer.instance.marshal(message), opts)
      }
    end
Publish a message to the designated exchange.

 @param [String] exname The exchange name
 @param [String] message Message body to be sent
 @param [Hash] opts Options with the message.
    :key => 'keyname'
 @return [void]

 @example Want to broadcast the data to all bound queues:
  publish_to('topic exchange', 'data', :key=>'*')
 @example Want to send the data to the specific queue(s):
  publish_to('exchange name', 'group.1', 'data')