How do I ensure that my task is processed by the right application?
When a HTM task is completed, a notification is published to the completion Kafka topic. Depending on how your application is deployed, you may need to consider filtering tasks to ensure that the appropriate response is only processed once by the appropriate system.
Filtering by flow
By default, an application using the HTM Flo Client will process all tasks where it has an instance of the target flow available. This ensures that responses are only processed by those flows that are expected to process them - other HTM responses are ignored.
This uses the default property configuration:
ipf.htm.receiver-type = default
Filtering by flow & running instance
When a flow is deployed in multiple places (for example a common reusable flow that is deployed alongside it’s main calling flow) it may be necessary to further filter the flow from the default behaviour. This is because although the default flow filtering will match, the actual instance of the flow will potentially be on a different deployment. To do that, we can switch the filtering modes by setting the property:
ipf.htm.receiver-type = receive-when-non-initial
Providing a custom implementation
It is also possible to provide a completely custom implementation of the handling of HTM completion responses. To do this we set the receiver type to custom:
ipf.htm.receiver-type = custom
When using this option, it is also then necessary to provide a custom implemenation of the 'HtmClientReceiveNotificationPort' that is provided by the core HTM API.