Examples of Producer


Examples of kafka.javaapi.producer.Producer

        Validate.notNull(topicSelector, "topicSelector can not be null");
        Map configMap = (Map) stormConf.get(KAFKA_BROKER_PROPERTIES);
        Properties properties = new Properties();
        properties.putAll(configMap);
        ProducerConfig config = new ProducerConfig(properties);
        producer = new Producer(config);
    }
View Full Code Here

Examples of kafka.perf.producer.Producer

      if(hosts.length >= numProducer)
        kafkaServerURL = hosts[i];
      else
        kafkaServerURL = hosts[random.nextInt(hosts.length)];

      producers[i] = new Producer(topic,kafkaServerURL, kafkaServerPort, kafkaProducerBufferSize, connectionTimeOut, reconnectInterval,
                                  messageSize, InetAddress.getLocalHost().getHostAddress()+ producerName +i, batchSize, numParts);
    }

    // Start the threads
    for(int i = 0; i < numProducer; i++)
View Full Code Here

Examples of net.openhft.chronicle.sandbox.queue.locators.shared.remote.Producer

                    maxSize,
                    byteBufferBytes.slice(),
                    byteBufferBytes.slice());

            if (type == Type.REMOTE_PRODUCER) {
                final Producer producer = new Producer<E, ByteBufferBytes>(new LocalRingIndex(), bytesDataLocator, bytesDataLocator, new ServerSocketChannelProvider(port), bytesDataLocator, buffer);
                ringIndex = producer;
                dataLocator = producer;
            } else {
                ringIndex = new Consumer<ByteBufferBytes>(new LocalRingIndex(), bytesDataLocator, bytesDataLocator, new ClientSocketChannelProvider(port, host), buffer);
                dataLocator = bytesDataLocator;
View Full Code Here

Examples of org.activemq.sampler.Producer

     *
     * @return returns a sampler
     */
    public TestElement createTestElement() {

        Producer sampler = new Producer();
        modifyTestElement(sampler);
        return sampler;
    }
View Full Code Here

Examples of org.apache.activemq.tool.Producer


    protected void createProducers() throws JMSException {
        producers = new Producer[producerCount];
        for (int i = 0; i < producerCount; i++) {
            producers[i] = new Producer(connectionFactory, destination);
            if (durable) {
                producers[i].setDeliveryMode(DeliveryMode.PERSISTENT);
            }
             else {
                producers[i].setDeliveryMode(DeliveryMode.NON_PERSISTENT);
View Full Code Here

Examples of org.apache.camel.Producer

    public boolean canSendToEndpoint(String endpointUri) {
        try {
            Endpoint endpoint = context.getEndpoint(endpointUri);
            if (endpoint != null) {
                Producer producer = endpoint.createProducer();
                return producer != null;
            }
        } catch (Exception e) {
            // ignore
        }
View Full Code Here

Examples of org.apache.camel.Producer

                Endpoint endpoint = exchange.getContext().getEndpoint(uri);
                if (endpoint == null) {
                    throw new NoSuchEndpointException(uri);
                }

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }

                // return the OUT body, but check for exchange pattern
View Full Code Here

Examples of org.apache.camel.Producer

        configureConsumer(answer);
        return answer;
    }

    public Producer createProducer() throws Exception {
        Producer answer = new NettyProducer(this, configuration);
        if (isSynchronous()) {
            return new SynchronousDelegateProducer(answer);
        } else {
            return answer;
        }
View Full Code Here

Examples of org.apache.camel.Producer

        final byte[] payload = Helper.stringToBytes(testMessage);
        final long jobId = 111;

        when(client.put(priority, delay, timeToRun, payload)).thenReturn(jobId);

        final Producer producer = endpoint.createProducer();
        assertNotNull("Producer", producer);
        assertThat("Producer class", producer, instanceOf(BeanstalkProducer.class));
        assertThat("Processor class", ((BeanstalkProducer) producer).getCommand(), instanceOf(PutCommand.class));

        final Exchange exchange = template.send(endpoint, ExchangePattern.InOnly, new Processor() { // TODO: SetBodyProcessor(?)
View Full Code Here

Examples of org.apache.camel.Producer

        final byte[] payload = Helper.stringToBytes(testMessage);
        final long jobId = 111;

        when(client.put(priority, delay, timeToRun, payload)).thenReturn(jobId);

        Producer producer = endpoint.createProducer();
        assertNotNull("Producer", producer);
        assertThat("Producer class", producer, instanceOf(BeanstalkProducer.class));
        assertThat("Processor class", ((BeanstalkProducer) producer).getCommand(), instanceOf(PutCommand.class));

        final Exchange exchange = template.send(endpoint, ExchangePattern.InOut, new Processor() { // TODO: SetBodyProcessor(?)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.