deliveredtechnologies / rulebook

100% Java, Lambda Enabled, Lightweight Rules Engine with a Simple and Intuitive DSL
http://www.deliveredtechnologies.com
Apache License 2.0
714 stars 123 forks source link

Rules Book engine behaves differently on same input #179

Open nitinsridar opened 4 years ago

nitinsridar commented 4 years ago

Implementing rules engine service using Spring boot. Every time If I hit the API with the below request I'm seeing different responses. The first 5 times it is behaving as expected then if I start sending requests continuously for every 10ms then responses are different and it continues to behave weird.

<dependency><groupId>com.deliveredtechnologies</groupId><artifactId>rulebook-spring</artifactId><version>0.11</version></dependency>

This is the dependency we are using for the rules engine service in our project.

Request:

{
   "division":12,
   "itemId":609372131802,
   "lcoation":"bengaluru",
   "buy":false,
   "sell":false,
   "home":null,
   "store":null,
}

Response 1:

{
   "division": 12,
   "itemId": 609372131802,
   "location": "bengaluru",
   "re": [
   "sellDB",
   "calculateAll",
   "buyDB"
  ]
}

Response 2:

{
   "division": 12,
   "itemId": 609372131802,
   "location": "bengaluru",
   "fulfillmentTypeList": [
   "buyDB"
  ]
}

Expected Response:

{
   "division": 12,
   "itemId": 609372131802,
   "location": "bengaluru",
   "fulfillmentTypeList": [
   "buyDB",
   "sellDB"
  ]
}
Clayton7510 commented 4 years ago

Can you attach the code that is having the issues? It would be helpful to see how you configured it. That way, I can determine if it's an issue with how the state is managed across threads or the spring config or something else.