Closed davsclaus closed 7 years ago
Oh nice found a little bug in camel-core: https://issues.apache.org/jira/browse/CAMEL-11131
Okay got a working prototype, I need to polish up and make the code nicer in a few spots.
@kcbabo @chirino should a connector either always be scheduled like this, or should the citizen user be able to choose (maybe indirectly without knowing).
So I have this as a before example, notice how it uses the from timer
from("timer:store?period=5000")
.to("petstore?operationId=getInventory")
.log("Pets in the store ${body}");
And now you can just do
from("petstore?operationId=getInventory&period=2000")
.log("Pets in the store ${body}");
And there is a default delay of 5000 so, you can do
from("petstore?operationId=getInventory")
.log("Pets in the store ${body}");
At this point the petstore connector is now forced into be a "from" only, but despite under the hood its actually a camel "to" but with a timer in from of it, eg from timer -> to petstore.
So in the ipaas it could be dual and made possible to use as a to endpoint as well. For example an pseudo example:
from("trade-insight:bestPetsToBuy")
.to("petstore?operationId=getPetsByIds")
.log("Bye these pets ${body}")
Okay CAMEL-11192 merged upstream, which means we need a new Fuse Camel EA build to include this for the connectors to use.
@jimmidyson ah just found a little bug in camel-core which we need to get fixed as needed by the trade-insight connector in binding mode. Can you cancel the build, and kick a new when I comment here again?
@davsclaus Cancelled. Let me know when you need a new one kicking. We should automate this...
The bug/issue which we need: https://issues.apache.org/jira/browse/CAMEL-11133
Okay pushed fix for Camel upstream. Not sure how fast fuse-camel sync from ASF.
And there is a PR here how to use the new schedule based as connector https://github.com/redhat-ipaas/connectors/pull/33
That is using 2.19.0-SNAPSHOT until we got that EA build.
The last commit you MUST ensure is in the EA is https://github.com/apache/camel/commit/95314057cf103039c0b44dbf2644ab06ea05d3f5
Ah the jboss fuse camel need to sync more commits, its not up to date https://github.com/jboss-fuse/camel/commits/master
Its up to date now
Thanks, Claus! I think this is consistent with the spirit of what we want - basically treating a polling connector as a single thing vs. multiple things (timer connector + endpoint connector).
The trade example need to use the timer scheduler to start the route.
We should allow to make a connector be scheduled and then do a producer call, so the trade example can start from the buy-recommendation