Push all byte array messages to the Kafka topic.
@param messages List of byte array messages to push to Kakfa.
333458
public void pushMessages(List<byte[]> messages) {
    for (byte[] message: messages) {
      this.futures.offer(producer.send(new ProducerRecord<>(topic, message), (recordMetadata, e) -> {
        if (e != null) {
          log.error("Failed to send message to topic {} due to exception: ", topic, e);
        }
      }));
    }

    //Once the low watermark of numFuturesToBuffer is hit, start flushing messages from the futures
    // buffer. In order to avoid blocking on newest messages added to futures queue, we only invoke future.get() on
    // the oldest messages in the futures buffer. The number of messages to flush is same as the number of messages added
    // in the current call. Note this does not completely avoid calling future.get() on the newer messages e.g. when
    // multiple threads enter the if{} block concurrently, and invoke flush().
    if (this.futures.size() >= this.numFuturesToBuffer) {
      flush(messages.size());
    }
  }
854116
protected final void putMessage(Http2Stream stream, FullHttpMessage message) {
        FullHttpMessage previous = stream.setProperty(messageKey, message);
        if (previous != message && previous != null) {
            previous.release();
        }
    }
525636
protected void pushMessage(StatusMessage msg) {
        if (connMsgOut != null) {
            try {
                connMsgOut.pushMessage(msg);
            } catch (IOException err) {
                log.error("Error while pushing message: {}", msg, err);
            }
        } else {
            log.warn("Consumer message output is null");
        }
    }
828091
final void addAll(Collection<Message> messages)
        throws NullPointerException {

        for (final Message message : messages) {
            add(message);
        }
    }
639960
public void sendUnreadMessagesAck(ArrayList<AVIMMessage> messages, String conversationId) {
    if (AVIMOptions.getGlobalOptions().isOnlyPushCount() && null != messages && messages.size() > 0) {
      Long largestTimeStamp = 0L;
      for (AVIMMessage message : messages) {
        if (largestTimeStamp < message.getTimestamp()) {
          largestTimeStamp = message.getTimestamp();
        }
      }
      AVConnectionManager.getInstance().sendPacket(ConversationAckPacket.getConversationAckPacket(getSelfPeerId(),
              conversationId, largestTimeStamp));
    }
  }
78367
protected static ByteBuffer[] toUDPBuffers(GelfMessage message, ThreadLocal<ByteBuffer> writeBuffers,
            ThreadLocal<ByteBuffer> tempBuffers) {

        while (true) {

            try {
                return message.toUDPBuffers(getBuffer(writeBuffers), getBuffer(tempBuffers));
            } catch (BufferOverflowException e) {
                enlargeBuffer(writeBuffers);
                enlargeBuffer(tempBuffers);
            }
        }
    }
594448
def message(topic, message)
      msg = formatted_topic(topic) + message.to_s.gsub(%r!\s+!, " ")
      messages << msg
      msg
    end
688033
public void broadcast(Iterator<String> peers, Message message) {
    while (peers.hasNext()) {
      send(peers.next(), message);
    }
  }
583917
public boolean send(String topic, String message) throws IOException {
        List<Session> sessions = topicSubscribers.get(topic);
        if (sessions != null) {
            for (Session session : sessions) {
                session.getBasicRemote().sendText(message);
            }
        }
        return sessions != null;
    }
136746
public static void push(final String message) {
		InternalLogger.log(org.tinylog.Level.WARN, "tinylog does not support NDC, \"" + message + "\" will be discarded");
	}
566599
public void publishToAll(String message) {
		StringBuffer buf = new StringBuffer(message);
		synchronized (clientSessions) {
			System.out.println("send message '" + message + "' to " + clientSessions.size() + " clients");

			Iterator<Session> it = clientSessions.iterator();
			while (it.hasNext()) {
				Session session = it.next();
				try {
					session.getRemote().sendString(buf.toString());
				} catch (IOException exception) {
					clientSessions.remove(session);
					it = clientSessions.iterator();
					try {
						session.close();
					} catch (Exception e) {
					}
				}
			}
		}

	}
19627
public void sendAllMessage() {
    if (!isConnected()) {
      return;
    }

    LOG.info("Flushing all pending data in MetricsManagerClient");
    // Collect all tuples in queue
    for (Communicator<Metrics.MetricPublisherPublishMessage> c : outMetricsQueues) {
      int size = c.size();
      for (int i = 0; i < size; i++) {
        Metrics.MetricPublisherPublishMessage m = c.poll();
        sendMessage(m);
      }
    }
  }
368052
public synchronized void sendMessage(final byte[] message) {
    this.send(ReefServiceProtos.JobStatusProto.newBuilder()
        .setIdentifier(this.jobIdentifier)
        .setState(ReefServiceProtos.State.RUNNING)
        .setMessage(ByteString.copyFrom(message))
        .build());
  }
203323
def push(self,message,message_type):
        
            
        super(Producer,self).send(message,message_type)
572121
public void setMessage(String message) {
    pushData.clear();
    Map<String, Object> map = AVUtils.createStringObjectMap("alert", message);
    pushData.put("data", map);
  }
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);
        }
    }
971175
public void setMessages(java.util.Collection<Message> messages) {
        if (messages == null) {
            this.messages = null;
            return;
        }

        this.messages = new java.util.ArrayList<Message>(messages);
    }