Is there a “topics” API or are you just thinking of a new feature? But the second example, I didn’t know you could fetchAndLock before deciding which topics to grab. That’s exactly what I need to do. For our implementation, we limit the number to lock based on the number of CPUs available and we spawn off threads for each locked task. We will have to rework our code to do it like your example, but sounds very promising.
You can close that JIRA ticket that I opened with the priority bug in the Java API. Sorry for hunt, but this does help on how to use the fetchAndLock API better so it’s very useful for me and others.
I believe his example is just doing a multi step builder. It’s only executing at the end. It’s not obvious from the code but can see he is only running the execution of the builder on the last line
the “topics” call is not in the API, this is just what I imagined the requested feature you were thinking of could look like, sorry for the missing clarification on this.
As for the example code, the fetchAndLock(...) method in the ExternalTaskService is always returning a query builder on which the execute() needs to be called when the configuration is done, as @StephenOTT correctly stated.
So you could add a new method to the ExternalTask builder that adds a LIKE capability.
From the looks of it, this should give you the ability to filter for your variables: so you can have a more generic Topic name, and then have a variable that you can use as the unique mapping.