Publish a message on a maniaflash channel
@param string $channelId
@param string $message
@param string $longMessage
@param string $mediaUrl
@return type
164511
public function postMessage($channelId, $message, $longMessage = null, $mediaURL = null)
	{
		return $this->execute('POST', '/maniaflash/channels/%s/', array(
			$channelId,
			array(
				'message' => $message,
				'longMessage' => $longMessage,
				'mediaURL' => $mediaURL)));
	}
194290
public function publish($messageType, Message $message, array $overridenConfig = array())
    {
        if (!$this->isKnownMessageType($messageType)) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown message type "%s". Available are [%s].',
                $messageType,
                implode(',', array_keys($this->messageTypes))
            ));
        }

        $config = $this->messageTypes[$messageType];

        $exchange = isset($overridenConfig['exchange']) ? $overridenConfig['exchange'] : $config['exchange'];
        $connection = isset($overridenConfig['connection']) ? $overridenConfig['connection'] : $config['connection'];
        $routingKey = isset($overridenConfig['routing_key']) ? $overridenConfig['routing_key'] : $config['routing_key'];

        $messagePublisher = $this->factory->getMessagePublisher($exchange, $connection);

        $this->logger->debug('Publish message in {exchange}:{routing_key} (connection {connection})', [
            'exchange' => $exchange,
            'routing_key' => $routingKey,
            'connection' => $connection,
        ]);

        $messagePublisher->publish($message, $routingKey);

        $this->eventDispatcher->dispatch(
            MessagePublishedEvent::NAME,
            new MessagePublishedEvent($messageType, $message, $connection, $exchange, $routingKey)
        );
    }
1320612
public void publish(Channel channel, DeliveryOptions deliveryOptions) throws IOException {
        // Assure to have a timestamp
        if (basicProperties.getTimestamp() == null) {
            basicProperties.builder().timestamp(new Date());
        }

        boolean mandatory = deliveryOptions == DeliveryOptions.MANDATORY;
        boolean immediate = deliveryOptions == DeliveryOptions.IMMEDIATE;

        LOGGER.info("Publishing message to exchange '{}' with routing key '{}' (deliveryOptions: {}, persistent: {})",
                new Object[] { exchange, routingKey, deliveryOptions, basicProperties.getDeliveryMode() == 2 });

        channel.basicPublish(exchange, routingKey, mandatory, immediate, basicProperties, bodyContent);
        LOGGER.info("Successfully published message to exchange '{}' with routing key '{}'", exchange, routingKey);
    }
1068550
public function sendChannelMethodFrame($channel, $methodSig, $args = '')
    {
        if ($args instanceof Writer) {
            $args = $args->getvalue();
        }

        $outboundPacket = new Writer();

        $outboundPacket->writeOctet(1);
        $outboundPacket->writeShort($channel);
        $outboundPacket->writeLong(
            strlen($args) + 4
        ); // 4 = length of class_id and method_id
        // in payload

        $outboundPacket->writeShort($methodSig[0]); // class_id
        $outboundPacket->writeShort($methodSig[1]); // method_id
        $outboundPacket->write($args);

        $outboundPacket->writeOctet(0xCE);
        $outboundPacket = $outboundPacket->getvalue();
        $this->write($outboundPacket);

        if ($this->debug) {
            Helper::debugMsg(
                '< ' . Helper::methodSig($methodSig) . ': ' .
                    AbstractChannel::$globalMethodNames[Helper::methodSig(
                        $methodSig
                    )]
            );
        }
        return $this;
    }
1004708
def publish(self, message):
        
        message_data = self._to_data(message)
        self._encode_invoke(topic_publish_codec, message=message_data)
370423
private void writeMessage(ModbusMessage msg) throws ModbusIOException {
        try {
            synchronized (byteOutputStream) {
                int len = msg.getOutputLength();
                byteOutputStream.reset();
                msg.writeTo(byteOutputStream);
                byte data[] = byteOutputStream.getBuffer();
                data = Arrays.copyOf(data, len);
                terminal.sendMessage(data);
            }
        }
        catch (Exception ex) {
            throw new ModbusIOException("I/O exception - failed to write", ex);
        }
    }
126262
public function message($channel, $message, $identity, array $attachments = [], array $clientOptions = [])
    {
        if (!$this->identityBag->has($identity)) {
            throw new \InvalidArgumentException(sprintf('identity "%s" is not registered', $identity));
        }

        return $this->client->send(
            Actions::ACTION_POST_MESSAGE,
            array_merge([
                'identity'    => $this->identityBag->get($identity),
                'channel'     => $channel,
                'text'        => $message,
                'attachments' => $attachments,
            ], $clientOptions)
        );
    }
485296
public function publish_async($channel, $data, $id=null, $prev_id=null,
            $callback=null)
    {
        $pub = $this->get_pubcontrol();
        $pub->publish_async($channel, new \PubControl\Item(
                new JsonObjectFormat($data), $id, $prev_id), $callback);
    }
624897
public KafkaMessage sendMessage(ProducerType type, KafkaMessage message) {
        String key = message.key();
        ProducerRecord<String, byte[]> record = StringUtils.isEmpty(key)
                ? new ProducerRecord<>(message.topic(), message.content())
                : new ProducerRecord<>(message.topic(), key, message.content());
        KafkaProducer<String, byte[]> producer = getJavaProducer(type);
        try {
            RecordMetadata metadata = producer.send(record).get();
            KafkaMessage kafkaMessage = new KafkaMessage(message);
            kafkaMessage.partition(metadata.partition());
            kafkaMessage.offset(metadata.offset());
            return kafkaMessage;
        } catch (InterruptedException | ExecutionException e) {
            throw new KafkaException(e);
        }
    }
351063
private void processMessageReceipt(String msgId, String conversationId, int convType, long timestamp) {
    Object messageCache =
            MessageReceiptCache.get(session.getSelfPeerId(), msgId);
    if (messageCache == null) {
      return;
    }
    Message m = (Message) messageCache;
    AVIMMessage msg =
            new AVIMMessage(conversationId, session.getSelfPeerId(), m.timestamp, timestamp);
    msg.setMessageId(m.id);
    msg.setContent(m.msg);
    msg.setMessageStatus(AVIMMessage.AVIMMessageStatus.AVIMMessageStatusReceipt);
    AVConversationHolder conversation = session.getConversationHolder(conversationId, convType);
    conversation.onMessageReceipt(msg);
  }
369148
public function createVideoForBroadcasting(string $mediaId, string $title, string $description)
    {
        return $this->httpPostJson('media/uploadvideo', [
            'media_id' => $mediaId,
            'title' => $title,
            'description' => $description,
        ]);
    }
921022
static function addMessage( $collaborationItem, $message, $messageType, $participantID = false )
    {
        $messageID = $message->attribute( 'id' );

        if ( !$messageID )
        {
            eZDebug::writeError( 'No message ID, cannot create link', __METHOD__ );
            $retValue = null;
            return $retValue;
        }
        if ( $participantID === false )
        {
            $user = eZUser::currentUser();
            $participantID = $user->attribute( 'contentobject_id' );
        }
        $collaborationID = $collaborationItem->attribute( 'id' );
        $timestamp = time();
        $collaborationItem->setAttribute( 'modified', $timestamp );

        $db = eZDB::instance();
        $db->begin();
        $collaborationItem->sync();
        $link = eZCollaborationItemMessageLink::create( $collaborationID, $messageID, $messageType, $participantID );
        $link->store();
        $db->commit();

        return $link;
    }
447067
def publish(self, msg, exchange, routing_key, mandatory=False,
                immediate=False, ticket=None):
        '''
        
        '''
        args = Writer()
        args.write_short(ticket or self.default_ticket).\
            write_shortstr(exchange).\
            write_shortstr(routing_key).\
            write_bits(mandatory, immediate)

        self.send_frame(MethodFrame(self.channel_id, 60, 40, args))
        self.send_frame(
            HeaderFrame(self.channel_id, 60, 0, len(msg), msg.properties))

        f_max = self.channel.connection.frame_max
        for f in ContentFrame.create_frames(self.channel_id, msg.body, f_max):
            self.send_frame(f)
1252085
public function publish($channel, $data, $id=null, $prev_id=null)
    {
        $pub = $this->get_pubcontrol();
        $pub->publish($channel, new \PubControl\Item(
                new JsonObjectFormat($data), $id, $prev_id));
    }
684954
public void sendMessage(String channel, Message message) {
        ensureChannel(channel);
        admin.getRabbitTemplate().convertAndSend(exchange.getName(), channel, message);
    }
832838
public function send($exchange, $routing_key, $message, $type = self::TYPE_TOPIC)
    {
        $message = $this->prepareMessage($message);
        if ($type == self::TYPE_TOPIC) {
            $this->channel->exchange_declare($exchange, $type, false, true, false);
        }
        $this->channel->basic_publish($message, $exchange, $routing_key);
    }
142538
@Override
	public void writeLong(long value) throws JMSException
    {
        try
        {
            getOutput().writeLong(value);
        }
        catch (IOException e)
        {
            throw new FFMQException("Cannot write message body","IO_ERROR",e);
        }
    }