Cancel
Showing results for 
Search instead for 
Did you mean: 

MessageSampler Processor in Dataflow engine API

Experimenter
Experimenter

Hi,

I am trying to create a stream with the MessageSampler processor using the dataflow engine API.

Following is the request I am trying to POST:

{

"name": "STREAM_1",
"definition": "TimeSeriesSource --entities=[{\"id\":\"***************\"}] | MessageSampler --duration="PT2M" | EventSink --entity-id-path=\"'***************'\" --severity=20 --description=\" Property below threshold!\"",
"deploy": true
}

 

However, I get the following error message:

[
  {
    "logref": "IllegalStateException",
    "message": "getReader() has already been called for this request"
  }
]

 

The same api and request works when I use FilterProcessor.

Any insights on this issue will be really helpful.

Thanks in advance!

3 REPLIES 3

Re: MessageSampler Processor in Dataflow engine API

Siemens Genius Siemens Genius
Siemens Genius

@Subrat I think you are missing the "--key=propertySetName" in your payload. Here is how you use the MessageSampler

 

{
  "name": "MessageSamplerExample",
  "definition": "TimeSeriesSource --entities=[{\"id\":\"f7173ba1bdb2...\"}] | MessageSampler  --key=yourPropertySetName --duration=\"PDT2M\" --split-list-to-items=true | EventSink --entity-id-path=\"'f7173ba1bdb2...'\" --severity=20 --description=\"Reached threshold  - sent using DFE!\"",
  "deploy": true
}



dfe.png

 

Re: MessageSampler Processor in Dataflow engine API

Experimenter
Experimenter

Thanks a lot for pointing that out @SriramSivakumar !

Now, I am able to create streams. However, events are not getting generated by the EventSink.

Following is the request I used to create stream:

 

{

"name": "STREAM_NAME1",
"definition": "TimeSeriesSource --entities=[{\"id\":\"***********\"}] | FilterProcessor --differentiating-key=\"V*********s\" --expression=\"newProperties.SOME_PROPERTY< 89 && newProperties.SOME_PROPERTY> 90\" --splitListToItems=true | MessageSampler --key=\"V**********s\" --duration=\"PT2M\" | EventSink --entity-id-path=\"'***************'\" --severity=20 --description=\" test notification. Kindly ignore!\"",
"deploy": true
}

 

Here, I have assumed that the 'key' in the MessageSampler is same as the 'differentiating-key' in TimeSeriesSource.

Could you please have a look and let me know if you are able to identify the problem here?

Thanks a lot!

 

P.S. When I create the stream without MessageSampler, events get triggered.

Re: MessageSampler Processor in Dataflow engine API

Siemens Genius Siemens Genius
Siemens Genius

Hi @Subrat can you try the following?

 

{
  "name": "HVAC-DFS12334",
  "definition": "TimeSeriesSource --entities=[{\"id\":\"0cbd383e17a244a1a6b610ab39e5abb3\"}] | FilterProcessor --expression=\"newProperties.TEMP >= 50\" --splitListToItems=true | MessageSampler --key=\"newProperties.TEMP\" --duration=\"PT10S\" | EventSink --entity-id-path=\"'0cbd383e17a244a1a6b610ab39e5abb3'\" --severity=20 --description=\"From DFE\"",
  "deploy": true
}

dfe2.png