def _send(self, context, event_type, data): self._ensure_connection() # TODO(sileht): don't split the payload into multiple network # message ... but how to do that without breaking consuming # application... try: for d in data: self._producer.send_messages(self._topic, jsonutils.dumps(d)) except Exception as e: messaging.raise_delivery_failure(e)