selects either a synchronous or an asynchronous producer, for the
specified broker id and calls the send API on the selected producer
to publish the data to the specified broker partition

@param ppd the producer pool request object
506276
public void send(ProducerPoolData<V> ppd) {
        if (logger.isDebugEnabled()) {
            logger.debug("send message: " + ppd);
        }
        if (sync) {
            Message[] messages = new Message[ppd.data.size()];
            int index = 0;
            for (V v : ppd.data) {
                messages[index] = serializer.toMessage(v);
                index++;
            }
            ByteBufferMessageSet bbms = new ByteBufferMessageSet(config.getCompressionCodec(), messages);
            ProducerRequest request = new ProducerRequest(ppd.topic, ppd.partition.partId, bbms);
            SyncProducer producer = syncProducers.get(ppd.partition.brokerId);
            if (producer == null) {
                throw new UnavailableProducerException("Producer pool has not been initialized correctly. " + "Sync Producer for broker "
                        + ppd.partition.brokerId + " does not exist in the pool");
            }
            producer.send(request.topic, request.partition, request.messages);
        } else {
            AsyncProducer<V> asyncProducer = asyncProducers.get(ppd.partition.brokerId);
            for (V v : ppd.data) {
                asyncProducer.send(ppd.topic, v, ppd.partition.partId);
            }
        }
    }
61581
void scheduleOnPostNotificationExecutor(@NonNull Runnable runnable, /* Milliseconds */ long delay) {
        try { postExecutor.schedule(runnable, delay, TimeUnit.MILLISECONDS); }
        catch (RejectedExecutionException ignore) { }
    }
904889
private void publishCheckpointEvent(String stepName, long jobInstanceId, long jobExecutionId, long stepExecutionId) {
        BatchEventsPublisher publisher = getBatchEventsPublisher();

        if (publisher != null) {
            String correlationId = runtimeWorkUnitExecution.getCorrelationId();
            publisher.publishCheckpointEvent(stepName, jobInstanceId, jobExecutionId, stepExecutionId, correlationId);
        }
    }
1045597
private void publishEvent(WSJobInstance objectToPublish, String eventToPublishTo, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobInstanceEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
689211
public ProducerPoolData<V> getProducerPoolData(String topic, Partition bidPid, List<V> data) {
        return new ProducerPoolData<V>(topic, bidPid, data);
    }
241348
@Override
	void sendTaskEvent(TaskEvent event) throws IOException {
		checkError();
		checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition.");

		if (!taskEventPublisher.publish(partitionId, event)) {
			throw new IOException("Error while publishing event " + event + " to producer. The producer could not be found.");
		}
	}
934909
public Future<KafkaMessage> sendMessageAsync(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);
        Future<RecordMetadata> fRecordMetadata = producer.send(record);
        FutureTask<KafkaMessage> result = new FutureTask<>(new Callable<KafkaMessage>() {
            @Override
            public KafkaMessage call() throws Exception {
                RecordMetadata recordMetadata = fRecordMetadata.get();
                if (recordMetadata != null) {
                    KafkaMessage kafkaMessage = new KafkaMessage(message);
                    kafkaMessage.partition(recordMetadata.partition());
                    kafkaMessage.offset(recordMetadata.offset());
                    return kafkaMessage;
                }
                throw new KafkaException("Error while sending message to broker");
            }
        });
        submitTask(result);
        return result;
    }
605647
public void setProducerConnectionUuid(SIBUuid12 producerConnectionUuid)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setProducerConnectionUuid", producerConnectionUuid);

        this.producerConnectionUuid = producerConnectionUuid;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setProducerConnectionUuid");
    }
493669
protected void sendCollectorDataToAnalyzerIfPresent(Serializable data) {
		if (analyzerStatusQueue != null) {
			logger.finer("Sending collector partition data: " + data + " to analyzer queue: " + analyzerStatusQueue);
			PartitionDataWrapper dataWrapper = new PartitionDataWrapper();
			dataWrapper.setCollectorData(data);
			dataWrapper.setEventType(PartitionEventType.ANALYZE_COLLECTOR_DATA);
			analyzerStatusQueue.add(dataWrapper);
		} else {
			logger.fine("Analyzer not configured.");
		}
	}
1306832
public MessageId send(ProducerConnectionContext context, BasicMessage basicMessage) throws JMSException {
        return send(context, basicMessage, null);
    }
1030792
protected byte[] selectPaymentEnvironment() throws CommunicationException {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Select " + (config.contactLess ? "PPSE" : "PSE") + " Application");
		}
		// Select the PPSE or PSE directory
		return provider.transceive(new CommandApdu(CommandEnum.SELECT, config.contactLess ? PPSE : PSE, 0).toBytes());
	}
477753
def publish(self, data, **kwargs):
        """"""
        assert data.get('op') in {'index', 'create', 'delete', 'update'}
        return super(Producer, self).publish(data, **kwargs)
1136196
public final void sendSentinel(long txnId, int partitionId) {
        final long initiatorHSId = m_cartographer.getHSIdForSinglePartitionMaster(partitionId);
        sendSentinel(txnId, initiatorHSId, -1, -1, true);
    }
865432
public void setProducer(org.apache.kafka.clients.producer.KafkaProducer<Object, Object> producer) {
        this.producer = producer;
    }
380557
public synchronized <Q extends T> void dispatchAsynchronous(final Q event, final IPostProcessor<Q> pPostProcessor) {

		new Thread(new Runnable() {

			@Override
			public void run() {

				try {

					// delegate dispatch result
					pPostProcessor.done(dispatch(event));

				} catch (DispatchException lEx) {

					// delegate exception handling as well
					pPostProcessor.done(lEx);

				}
			}
		}).start();

	}
1265955
public boolean publish(String topicName, DefaultMessage message,boolean asynSend){
		if(routeEnv != null)topicName = routeEnv + "." + topicName;
		return producer.publish(topicName, message,asynSend);
	}
1083205
private String getProducerId(final ProceedingJoinPoint pjp, final String aPId, final boolean withMethod) {
		if (!StringUtils.isEmpty(aPId))
			return aPId;

		String res = pjp.getSignature().getDeclaringTypeName();
		try {
			res = MoskitoUtils.producerName(res);
		} catch (final RuntimeException e) {
			if (logger.isTraceEnabled())
				logger.trace(e.getMessage(), e);
		}
		if (withMethod) {
			res += DOT + getMethodStatName(pjp.getSignature());
		}
		return res;
	}