V0.4.3 Filtering Events
I hope you are well. Here in Paris, we are in a new lockdown and are not authorized anymore to visit our beautiful countryside. But that’s ok, the last couple of weeks were busy, and today I’m pleased to announce the v0.4.3 release.
But before describing what is in it, I want to take a step back and explain why it may still feel complex to integrate Infinitic into existing architecture. I’m guessing you already have events in Kafka (or RabbitMQ, or even Pulsar) in production and want to give Infinitic a try, as you experience difficulties orchestrating some of your processes.
You need a bridge between your Kafka and Infinitic.
This bridge will read events from your Kafka and forward them to Infinitic:
- Some events would trigger new workflows.
- Some events should be sent to running workflows to influence their behavior.
- Some events would do both.
Triggering workflows is the easy part: you just need to know which event will start which workflow.
Sending events to existing workflows is trickier as you need to know which workflow instances are running and waiting for which events. That’s a lot to manage for the bridge.
To solve this problem, we introduce a new feature that gives workflows the ability to state explicitly which events are waited. Since the v0.4.3 release, workflows can wait for an event (through channels) of a specific type (ValidationEvent in the example below):
Deferred<ValidationEvent> deferred = getEventChannel().receive(ValidationEvent.class);
But also, based on the event’s attributes (a specific userId in the example below), using a JSONPath syntax (applied to the JSON serialization of the event):
Deferred<Event> deferred = getEventChannel().receive("[?]", where("userId").eq("ef20b7a9-849b-41f8-89e9-9c5492efb098"));
This JSONPath syntax is very rich and lets you define precisely the test you need.
Personally, I am excited by this feature that I wanted to have since my previous project Zenaton. It’s a big step towards making Infinitic really easy to integrate into existing infrastructure. That’s not the last one. Stay tuned 😉
As always, please send us your feedback, questions, or reactions ❤️.