azure-servicebus/azure/servicebus/send_handler.py
def send(self, message):
        """Send a message and blocks until acknowledgement is received or the operation fails.

        :param message: The message to be sent.
        :type message: ~azure.servicebus.common.message.Message
        :raises: ~azure.servicebus.common.errors.MessageSendFailed if the message fails to send.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START send_message]
                :end-before: [END send_message]
                :language: python
                :dedent: 4
                :caption: Send a message and block

        """
        if not isinstance(message, Message):
            raise TypeError("Value of message must be of type 'Message'.")
        if not self.running:
            self.open()
        if self.session_id and not message.properties.group_id:
            message.properties.group_id = self.session_id
        try:
            self._handler.send_message(message.message)
        except Exception as e:
            raise MessageSendFailed(e)
def send(self, message):
        """Send a message and blocks until acknowledgement is received or the operation fails.

        :param message: The message to be sent.
        :type message: ~azure.servicebus.common.message.Message
        :raises: ~azure.servicebus.common.errors.MessageSendFailed if the message fails to send.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START send_message]
                :end-before: [END send_message]
                :language: python
                :dedent: 4
                :caption: Send a message and block

        """
        if not isinstance(message, Message):
            raise TypeError("Value of message must be of type 'Message'.")
        if not self.running:
            self.open()
        if self.session_id and not message.properties.group_id:
            message.properties.group_id = self.session_id
        try:
            self._handler.send_message(message.message)
        except Exception as e:
            raise MessageSendFailed(e)
Send a message and blocks until acknowledgement is received or the operation fails.

        :param message: The message to be sent.
        :type message: ~azure.servicebus.common.message.Message
        :raises: ~azure.servicebus.common.errors.MessageSendFailed if the message fails to send.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START send_message]
                :end-before: [END send_message]
                :language: python
                :dedent: 4
                :caption: Send a message and block