Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Generic Producer Configuration Parameters

  • name (string, required) 
    • Unique name to identify the stage in the pipeline. It is used programatically to retrieve the stage and be able to consume the produced output.
  • queueSize (integer, optional) - Default 10000
    • Max number of produced items to keep in memory at a time.
  • queueTimeout (integer, optional) - Default 1000 ms
    • Blocking queue timeout to wait for new items.
  • queueRetries (integer, optional) - Default 3
    • Number of retries before unblocking the queue.
  • singleSubscriber (boolean, optional) - Default to false
    • 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

Code Block
languagejava
themeFadeToGrey
titleProducer 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());