Send event to kafka.

@param topic   the kafka topic
@param content the event content
515781
@Async
    public void send(String topic, String content) {
        try {
            if (!StringUtils.isBlank(content)) {
                log.debug("Sending kafka event with data {} to topic {}", content, topic);
                template.send(topic, content);
            }
        } catch (Exception e) {
            log.error("Error send timeline event", e);
            throw e;
        }
    }
79307
private void publish(String buffer){
        CommandResult out = new CommandResult(myType);

        out.setContent(buffer);

        synchronized (lock) {
            publisher.publish(topic, out.toString());
        }
    }
1341194
public void publishInternal(Object message) {
        topicStats.incrementPublishes();
        topicService.publishMessage(name, message, multithreaded);
    }
282655
function(self, eventType, content) {
    return self.client.sendEvent(self.roomId, eventType, content);
}
1079541
function(req, topic, messages){
    payloads[0]['topic'] = topic
    payloads[0]['messages']= JSON.stringify(messages);
    console.log(payloads[0]['messages']);
    setTimeout(function () {
        producer.send(payloads, function (err, data) {
            if(err){
                console.log(err);
            }
        });
        producer.on('error', function (err) {
            console.log(err);
        });
    }, 1000);
}
1141781
public static void sendText(Collection<String> tos, String subject, String content, File... files) {
		send(tos, subject, content, false, files);
	}
310552
public void setTopic(String topic)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setTopic", topic);

    this.topic = topic;

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setTopic");
  }
932997
public void broadcastTextMessage(String topicName, String textMessage, int delaySeconds)
            throws NamingException, JMSException, ServiceLocatorException {
        if (mdwMessageProducer != null) {
            mdwMessageProducer.broadcastMessageToTopic(topicName, textMessage);
        }
        else {
            TopicConnectionFactory tFactory = null;
            TopicConnection tConnection = null;
            TopicSession tSession = null;
            TopicPublisher tPublisher = null;
            try {
                // if (logger.isDebugEnabled()) logger.debug("broadcast JMS
                // message: " +
                // textMessage);
                // cannot log above - causing recursive broadcasting
                tFactory = getTopicConnectionFactory(null);
                tConnection = tFactory.createTopicConnection();
                tSession = tConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
                Topic topic = getTopic(topicName);
                tPublisher = tSession.createPublisher(topic);

                // TODO: platform-independent delay
                // WLMessageProducer wlMessageProducer =
                // (WLMessageProducer)tPublisher;
                // long delayInMilliSec = 0;
                // if(pMinDelay > 0){
                // delayInMilliSec = delaySeconds*1000;
                // }
                // wlMessageProducer.setTimeToDeliver(delayInMilliSec);
                TextMessage message = tSession.createTextMessage();
                tConnection.start();

                message.setText(textMessage);
                tPublisher.publish(message, DeliveryMode.PERSISTENT,
                        TextMessage.DEFAULT_DELIVERY_MODE, TextMessage.DEFAULT_TIME_TO_LIVE);
                // }catch(ServiceLocatorException ex){
                // ex.printStackTrace();
                // never log exception here!!! infinite loop when publishing log
                // messages
                // throw new JMSException(ex.getMessage());
            }
            finally {
                closeResources(tConnection, tSession, tPublisher);

            }
        }
    }
462307
private void publishEvent(WSJobExecution jobEx, String topicToPublish, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobExecutionEvent(jobEx, topicToPublish, correlationId);
        }
    }
180119
private static void publishEvent(String event, SiteNode node) {
		ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node)));
	}
115036
public void processSend(ByteBuffer content) {
        LOG.entering(CLASS_NAME, "processSend", content);
        if (readyState != State.OPENED && readyState != State.HEADERS_RECEIVED) {
            throw new IllegalStateException(readyState + " HttpRequest must be in an OPEN state before " + "invocation of the send() method");
        }
        try {
            if (!async && content != null && content.hasRemaining()) {
                connection.setDoOutput(true);
                connection.setDoInput(true);
                
                OutputStream out = connection.getOutputStream(); 
                out.write(content.array(), content.arrayOffset(), content.remaining());
                out.flush();
            }
            
            connection.connect();
            reader = new StreamReader();
            Thread t = new Thread(reader, "HttpRequestDelegate stream reader");
            t.setDaemon(true);
            t.start();
        }
        catch (Exception e) {
            LOG.log(Level.FINE, "While processing http request", e); 
            // e.printStackTrace();
            listener.errorOccurred(new ErrorEvent(e));
        }
    }
288696
public void setContent(final WComponent content) {
		WComponent oldContent = getContent();

		if (oldContent != null) {
			remove(oldContent);
		}

		if (content != null) {
			add(content);
		}
	}
1200028
public final void setContent(byte[] content)
    {
        //clear non relevant flags
        this.contentString=null;
        this.contentParts=null;
        this.contentType=ContentType.BINARY;

        if(content==null)
        {
            this.contentBinary=null;
        }
        else
        {
            this.contentBinary=content.clone();
        }
    }
760729
public EventImpl publishEvent(Event event, boolean async) {
        EventImpl eventImpl = (EventImpl) event;
        eventImpl.setReadOnly(true);
        EventImpl currentEvent = (EventImpl) CurrentEvent.get();
        if (null != currentEvent) {
            eventImpl.setParent(currentEvent);
        }

        // Attempt to get the Topic object and cached TopicData but fallback
        // to the topic name if the Topic object wasn't populated
        Topic topic = eventImpl.getTopicObject();
        String topicName = topic != null ? topic.getName() : eventImpl.getTopic();
        TopicData topicData = topicCache.getTopicData(topic, topicName);
        eventImpl.setTopicData(topicData);

        // Required Java 2 Security check
        checkTopicPublishPermission(topicName);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Publishing Event", topicName);
        }

        // Obtain list of matching handlers: returned list of handlers
        // must be thread safe!
        List<HandlerHolder> holders = topicData.getEventHandlers();
        ExecutorService executor = topicData.getExecutorService();

        if (async) {
            int i = 0;
            // Handle asynchronous events.
            Future<?>[] futures = new Future<?>[holders.size()];
            for (HandlerHolder holder : holders) {
                holder.addEvent(eventImpl);
                futures[i++] = queueWorkRequest(holder, executor);
            }
            eventImpl.setFutures(futures);
        } else {
            // fire synchronous events
            for (HandlerHolder holder : holders) {
                holder.fireSynchronousEvent(eventImpl);
            }
        }

        return eventImpl;
    }
826472
public void setContent(IContent content)
	{
		this.content = content;
		content.setParent(this);
		content.setPosition(Position.of(15, 2));
	}
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
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;
    }