user2451444
user2451444

Reputation: 5

Siddhi Distributed Cache Mode Deployment

According to the docs (https://docs.wso2.org/display/CEP310/Clustered+Deployment), you can run Siddhi in distributed mode.

As fas as i understand, all nodes will share the streams definitions and operate over a shared context (streams, queries, events...).

But i can't put it to work:

  1. Working with 2.0.0-wso2v4 version
  2. I've coded a simple program that starts two siddhiManagers with distributed processing enabled.
  3. The program creates a stream and a query in siddhiManager1
  4. Adds a stream callback that print events in the two managers (previous stream)
  5. Send an event in siddhiManager1
  6. Prints streams in siddhiManager1 and siddhiManager2

The result is:

I've tested by using siddhi-distribution (fat-jar), but also using siddhi-api, siddhi-core and siddhi-query jars.

Siddhi-distribution fat-jar has some xml inside related to Hazelcast, but as fas as i can see these configs are not being loaded and in the source code (github) i don't see anything special about these files (siddhiManager).

Any idea about how can i run siddhi in distributed cache mode deployment? what am i doing wrong?

Upvotes: 0

Views: 559

Answers (1)

Rajeev Sampath
Rajeev Sampath

Reputation: 2757

Siddhi does not replicate artifacts (queries, stream definitions) through Hazelcast. It shares only events/state of the engine. So in order to get this working, you'll have to first separately synchronize these queries/stream definitions across all Siddhi instances in your distributed setup. Once you have those in place, you'll be able to get it working in distributed mode.

Note that the above explanation is assuming that you are using just the Siddhi library without WSO2 CEP product. In WSO2 CEP, there is a mechanism to synchronize these deployment artifacts among the nodes in a distributed setup.

Upvotes: 1

Related Questions