Generic Producer Configuration Parameters

  • name ( type=string | required ) - Unique name to identify the stage in the pipeline
    •  It is used programmatically to retrieve the stage and consume the produced output.
  • queueSize ( type=integer | default=10000 | optional ) - Max number of produced items to keep in memory at a time.
  • queueTimeout ( type=integer | default=1000 | optional ) - Blocking queue timeout to wait for new items in miliseconds
  • queueRetries ( type=integer | default=3 | optional ) - Number of retries before unblocking the queue
  • singleSubscriber ( type=boolean | default=false | optional )
    • If true, a single queue is created and a thread can consume the items being produced by multiple reset/advance calls to the engine. 
    • If false, each time an engine reset is issued, the queue is cleared (consume the queue before reset). 
    • Single subscriber works well with asynchronous subscription to the queue.

Get a reference to the producer stage and consume the queue

Producer Stage
ResultsProducerStage stage = engine.getProducer("ProducerName");
String inputText = "This is a test entry";
Reader in = new StringReader(inputText);
engine.reset(in);
while(engine.advance() != null);
List<String> output = (List<String>) producer.stream().collect(Collectors.toList());
  • No labels