Comments (7)
Esper CEP has several time and cron-like features in Patterns like timer:interval:
every timer:interval(10 min)
from fiware-cepheus.
Thanks, I didn't see it on the doc. But when I'm using that parameter I get the following error:
Caused by: com.espertech.esper.client.EPStatementSyntaxException: Incorrect syntax near ':' at line 1 column 185, please check the output rate clause [INSERT INTO Event SELECT idEvent as id, dFlag as dFlag, cast(current_timestamp() ,string) as Title, wFlag as wFlag, mFlag as mFlag, idEvent as idEvent FROM Pevent OUTPUT ALL EVERY timer:interval(1 min)]
Due to the output rate but don't know how to solve it.
My sentence is:
INSERT INTO Event SELECT idEvent as id, dFlag as dFlag, cast(current_timestamp() ,string) as Title, wFlag as wFlag, mFlag as mFlag, idEvent as idEvent FROM Pevent OUTPUT ALL EVERY timer:interval(1 min)
I want it to run it every 1 min and, when the cep broker notifies changes to. What should I do?
from fiware-cepheus.
You are mixing the syntax for output limiting and the syntax for Patterns.
Patterns cannot be applied to output expressions, they are used in the FROM
clause:
SELECT Pevent.id, Pevent.attr1, Pevent.attr2 FROM pattern[every timer:interval(10 min)]
Please use SO with the esper tag for questions related the Esper language, you might get better answers.
from fiware-cepheus.
An additional note: generating events on a fixed interval to update NGSI entities seems like a bad idea.
CEP are made to react to events (and "smartly" limiting them as output), not generating new entities updates all the time...
from fiware-cepheus.
Thanks for the answer but I still don't get how to solve my problem. Let me explain it a bit more.
I have this cep config:
{
"host":"http://localhost:1028",
"in":[
{
"id":"A.*",
"type":"Pevent",
"isPattern":true,
"providers":[
"http://localhost:1027" //
],
"attributes":[
{ "name":"idEvent", "type":"string" },
{ "name":"endDate", "type":"date" }
]
}
],
"out":[
{
"id":"A",
"type":"Event",
"brokers":[
{
"url":"http://localhost:1026" //orion
}
],
"attributes":[
{ "name":"expired", "type":"int" }
]
}
],
"statements":[
"INSERT INTO Event SELECT idEvent as id, case when endDate<current_timestamp() then 1 else 0 end as expired FROM Pevent OUTPUT all"
]
}
This config when new entity is aded or modified in cepheus context broker, it notifies cepheus cep and cep calculates if the entity is expired or not and send the result to orion.This is working ok with no problem.
The problem now is that I need to recalculate the expired attribute one time per hour and i don't know if it is possible in cep cause I can't make it work.
from fiware-cepheus.
I did ask it on stack overflow to http://stackoverflow.com/questions/37466515/how-to-correctly-configure-cepheus-cep-to-recalculate-a-attribute-every-hour
from fiware-cepheus.
I just posted an answer http://stackoverflow.com/questions/37466515/how-to-correctly-configure-cepheus-cep-to-recalculate-a-attribute-every-hour/37477234#37477234
from fiware-cepheus.
Related Issues (20)
- Add guaranteed delivery to Cepheus Broker HOT 5
- Adding persistance to Cepheus HOT 1
- Compatibility with Orion 1.X.X
- Error with cepheus Broker 0.1.7 HOT 1
- Use Docker parameters for Cepheus configuration HOT 2
- Exception logging HOT 1
- Example mocks crash on updateContextResponse HOT 1
- Improve documentation for exampel 3_CepAndBroker HOT 1
- Cepheus CEP in a multi-tenancy way HOT 8
- Cepheus multiple statements HOT 1
- change remote.url in docker container HOT 8
- Cepheus-CEP multitenancy issue on filtering requests HOT 6
- Stack Overflow Error processing rules with nested geopoint type attributes HOT 2
- Cepheus does not send subscribeContext request on changing ServiceName and ServicePath HOT 2
- Incorrect processing for notification about changes in multiple context entities. HOT 4
- Cepheus-CEP multitenancy issue for multi-tenant provider HOT 5
- Cepheus-CEP multitenancy issue for multiple subscription HOT 1
- Cepheus CEP DELETE request doesn't unsubscribe Provider
- Cepheus-CEP does not hold multiple subscription in multi-tenant mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiware-cepheus.