Creates a new {@link QueueProducer}. The producer accepts arbitrary objects and uses the Jackson object mapper to convert them into
JSON and sends them as a text message.
10062
public QueueProducer<Object> createQueueJsonMessageProducer(final String topic)
    {
        Preconditions.checkState(connectionFactory != null, "connection factory was never injected!");
        return new QueueProducer<Object>(connectionFactory, jmsConfig, topic, producerCallback);
    }
1055944
private B newProcessBuilder(Class[] param_types, Object[] params)
    {
        if (process_builder_class != null)
        {
            try
            {
                Constructor<B> constructor = process_builder_class.getDeclaredConstructor(param_types);
                return constructor.newInstance(params);
            }
            catch (Exception e)
            {
                throw new QueujException(e);
            }
        }

        if (parent_queue != null)
            return (B)parent_queue.newProcessBuilder(param_types, params);

        // else
        throw new QueujException("No ProcessBuilder exists for Queue");
    }
59425
def process_message(consumer_class, delivery_info, properties, message)
      message = JSON.parse(message, symbolize_names: true)

      message_id = message.fetch(:message_id)
      produced_at = message.fetch(:produced_at)
      payload = message.fetch(:payload)

      logger.info "Processing message #{message_id} via #{consumer_class}, produced at #{produced_at}"
      set_process_name(consumer_class, message_id)

      consumer = consumer_class.new(delivery_info, logger)
      @consumer_instances << consumer

      instrumentation_options = {
        consumer_class: consumer_class.to_s,
        queue_name: consumer_class.queue_name,
        message_id: message_id,
        produced_at: produced_at,
      }
      ActiveSupport::Notifications.instrument('consume_message.songkick_queue', instrumentation_options) do
        begin
          consumer.process(payload)
        ensure
          @consumer_instances.delete(consumer)
        end
      end
    rescue Object => exception
      logger.error(exception)
      channel.reject(delivery_info.delivery_tag, config.requeue_rejected_messages)
    else
      channel.ack(delivery_info.delivery_tag, false)
    ensure
      set_process_name
    end
1259409
@Override
    public <T> Producer<T> createProducer(final Bean<X> declaringBean, final Bean<T> bean, DisposalMethod<X, T> disposalMethod) {
        EnhancedAnnotatedField<T, X> enhancedField = getManager().getServices().get(MemberTransformer.class).loadEnhancedMember(field, getManager().getId());
        return new ProducerFieldProducer<X, T>(enhancedField, disposalMethod) {

            @Override
            public AnnotatedField<X> getAnnotated() {
                return field;
            }

            @Override
            public BeanManagerImpl getBeanManager() {
                return getManager();
            }

            @Override
            public Bean<X> getDeclaringBean() {
                return declaringBean;
            }

            @Override
            public Bean<T> getBean() {
                return bean;
            }
        };
    }
712715
public DistributedQueue<T>      buildQueue()
    {
        return new DistributedQueue<T>
        (
            client,
            consumer,
            serializer,
            queuePath,
            factory,
            executor,
            Integer.MAX_VALUE,
            false,
            lockPath,
            maxItems,
            putInBackground,
            finalFlushMs
        );
    }
1163213
@Override
	public QueueBrowser createBrowser(Queue queueRef, String messageSelector) throws JMSException
    {
    	return createBrowser(idProvider.createID(), queueRef, messageSelector);
    }
865432
public void setProducer(org.apache.kafka.clients.producer.KafkaProducer<Object, Object> producer) {
        this.producer = producer;
    }
1029412
public <K extends Serializable & Comparable> Process<K> newProcess()
    {
        final String queueOwner = partition == null ? null : partition.getQueueOwnerKey();
        Callback<ProcessWrapper<K>> callback = new Callback<ProcessWrapper<K>>() {

            @Override
            protected void doAction() {

                ProcessWrapper<K> process = ProcessWrapper.getNewInstance(
                        queueOwner, is_persistent, implementation_options);

                ProcessPersistence<ProcessEntity<K>,K> processHome = 
                        process.setDetails(process_name, queue, process_description, user,
                                           occurrence, visibility, access, resilience, output,
                                           pre_processes, post_processes, keep_completed,
                                           process_listeners, locale, implementation_options);

                if (report_type != null)
                    process.setReportType(report_type);

                if(source_name != null)
                    process.setSourceName(source_name);

                setupProcess(new Process(process));

                preSubmitBatchJobProcessing();

                if (is_persistent) processHome.persist();

                process.getContainingServer().submitProcess(process);

                _return(process);
            }
        };

        QueujTransaction<K> transaction = (QueujTransaction<K>)QueujFactory.getTransaction();
        return new Process<K>(transaction.doTransaction(queueOwner, is_persistent, callback, true));
    }
485706
public Producer createProducer() throws Exception {
        LOG.debug(this.toString());
        ObjectHelper.notNull(this.mode, "mode");
        GpioPin pin = isAlreadyProvisioned();
        if (pin == null) {
            switch (this.mode) {
            case DIGITAL_OUTPUT:
                pin = getOrCreateController().provisionDigitalOutputPin(getPin(), state);
                break;
            case ANALOG_OUTPUT:
                pin = getOrCreateController().provisionAnalogOutputPin(getPin(), value);
                break;
            case PWM_OUTPUT:
                pin = getOrCreateController().provisionPwmOutputPin(getPin(), (int) value);
                break;
            case ANALOG_INPUT: // PinMode.allInput()
            case DIGITAL_INPUT:
                LOG.error("Cannot create Producer with INPUT Mode");
                return null;
            default:
                LOG.error("Cannot create Producer w/o Mode");
                break;
            }
            pin.setMode(this.mode); // Force Mode to avoid NPE
        } else { // enhancement we could manage several pins with one producer
            throw new IllegalArgumentException(
                    "Cannot create twice same output gpio [" + this.gpioId + "] for Producer");
        }

        // shutdownOption(pin);
        return new GPIOProducer(this, pin, action);
    }
655387
public <T> QueueBufferMaker<T> createQueueBuffer( Serializer<T> serializer ) {
        return new MakeOrderedBuffer<T>("buffer-" + dbCounter.incrementAndGet(), serializer);
    }
36713
@Override
    public Producer createProducer() throws Exception {
        LOG.debug(this.toString());

        if (direction == null || (direction.compareTo("") == 0)) {
            direction = "DIR_OUTPUT_ONLY";
        }
        if (mode == null || (mode.compareTo("") == 0)) {
            mode = "MODE_OUTPUT_PUSH_PULL";
        }
        if (trigger == null || (trigger.compareTo("") == 0)) {
            trigger = "TRIGGER_NONE";
        }

        int internalDirection = internalValueWithOR(direction);
        int internalMode = internalValueWithOR(mode);
        int internalTrigger = internalValueWithOR(trigger);

        GPIOPinConfig pinConfig = new GPIOPinConfig(DeviceConfig.DEFAULT, Integer.parseInt(this.gpioId),
                internalDirection, internalMode, internalTrigger, state);
        GPIOPin pin = DeviceManager.open(GPIOPin.class, pinConfig);

        return new GPIOProducer(this, pin);
    }
1196914
@Override
    public FacilityRejectedMessage createFRJ() {
        FacilityRejectedMessage msg = new FacilityRejectedMessageImpl(_FRJ_HOLDER.mandatoryCodes,
                _FRJ_HOLDER.mandatoryVariableCodes, _FRJ_HOLDER.optionalCodes, _FRJ_HOLDER.mandatoryCodeToIndex,
                _FRJ_HOLDER.mandatoryVariableCodeToIndex, _FRJ_HOLDER.optionalCodeToIndex);

        return msg;
    }
1200519
@Override
    public void sendInternal(NotificationType type, String... messages) throws NotificationException {
        if (producer == null) {
            createProducer();
        }
        sendInternalToProducer(producer, type, messages);
    }
1312529
public <K, V> void produce(String topic, KafkaProducer<K, V> producer, Map<K, V> data) {
        data.forEach((k, v) -> producer.send(new ProducerRecord<>(topic, k, v)));
        producer.flush();
    }
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);
        }
    }
695091
@Override
	public MessageProducer createProducer(Destination destination) throws JMSException
    {
    	externalAccessLock.readLock().lock();
    	try
		{
	        checkNotClosed();
	        LocalMessageProducer producer = new LocalMessageProducer(this,destination,idProvider.createID());
	        registerProducer(producer);
	        return producer;
		}
    	finally
    	{
    		externalAccessLock.readLock().unlock();
    	}
    }
698563
public QueueBuilder<T>  threadFactory(ThreadFactory factory)
    {
        Preconditions.checkNotNull(factory, "factory cannot be null");

        this.factory = factory;
        return this;
    }