Service Orchestration in Knative

4/18/2020

We have one complex service, which we want to decompose into different services and do orchestration. Since most of the services won't be required to be exposed, I was thinking if we can do Knative serving & eventing with Vertx.

For simple chaining, I was initially tried to just prepare a service which sends events to default broker and with broker trigger I am able to get the event in another Vertx. But with Broker Trigger, I am not sure how to reply to the event generator service.

Lately I tried to use, Camel-K which seems a bit more simpler from vertx service writing though it uses Vertx internally, I am able to communicate through Knative channel.

Sending Event Camel-K:

from('timer:clock?period=3s')
.setBody().constant("This is Sample Message")
.to('knative:channel/messages')
.log('sent message to messages channel')

Receiving Event in Camel-k:

from('knative:channel/messages')
   .log('got ${body}')

what would be the way I can send reply from Receiver Camel-K such that Sending Camel-K receives the message and process further.

Use-case is more like, a service been exposed such that other application can call. After receiving the request, it will transform and orchestrate on 2 more services through eventing and then reply back to the caller.

If there is any example in Github, it would be really helpful if you can point me. Want to implement either Camel / Vertx on Knative.

-- Debapriya
apache-camel
knative
kubernetes
vert.x

0 Answers