Versions Compared

Key

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

Generic Producer Configuration Parameters

  • Parameter
    summary
    name (string, required) 
    Unique name to identify the stage in the pipeline
    namename
    requiredtrue
    •  It . It is used programatically programmatically to retrieve the stage and be able to consume the produced output.
  • Parameter
    summary
    queueSize (integer, optional) - Default 10000
    Max number of produced items to keep in memory at a time.
    default10000
    namequeueSize
    typeinteger
  • Parameter
    summary
    queueTimeout (integer, optional) - Default 1000 ms
    Blocking queue timeout to wait for new items
    .queueRetries (
    in miliseconds
    default1000
    namequeueTimeout
    typeinteger
  • Parameter
    summary
    integer, optional) - Default 3
    Number of retries before unblocking the queue
    .
    default3
    namequeueRetries
    typeinteger
  • Parameter
    defaultfalse
    namesingleSubscriber
    typeboolean
    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());