Skip to content

Commit e5ae376

Browse files
committed
Added details about implementing your own custom downstream services
1 parent 4f3e6fb commit e5ae376

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/usage.md

+45
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,48 @@ The following tools services can be made available using Wanaku and used to prov
232232
| `http` | wanaku-routing-http-service | Provides access to HTTP endpoints as tools via Wanaku |
233233
| `yaml-route` | wanaku-routing-yaml-route-service | Provides access to Camel routes in YAML tools via Wanaku |
234234
| `kafka` | wanaku-routing-kafka-service | Provides access to Kafka topics as tools via Wanaku |
235+
236+
237+
## Adding Your Own Resource Provider or Tool Service
238+
239+
Wanaku leverages the Apache Camel to provide connectivity to a vast range of services and platforms. Although we
240+
aim to provide many of them out-of-the box, not all of them will fit all the use cases. That's why we make it
241+
simple for users to create custom services that solve their particular need.
242+
243+
### Creating a New Resource Provider
244+
245+
To create a custom resource provider, you can run:
246+
247+
```shell
248+
mvn -B archetype:generate -DarchetypeGroupId=ai.wanaku -DarchetypeArtifactId=wanaku-provider-archetype -DarchetypeVersion=0.0.1 -DgroupId=ai.wanaku -Dpackage=ai.wanaku.provider -DartifactId=wanaku-provider-s3 -Dname=S3 -Dwanaku-version=0.0.1
249+
```
250+
251+
### Creating a New Tool Service
252+
253+
To create a custom tool service, you can run:
254+
255+
```shell
256+
mvn -B archetype:generate -DarchetypeGroupId=ai.wanaku -DarchetypeArtifactId=wanaku-tool-service-archetype -DarchetypeVersion=0.0.1 -DgroupId=ai.wanaku -Dpackage=ai.wanaku.routing.service -DartifactId=wanaku-routing-jms-service -Dname=JMS -Dwanaku-version=0.0.1
257+
```
258+
259+
### Adjusting Your Resource Provider or Tool Service
260+
261+
After created, then most of the work is to adjust the auto-generated `Delegate` class to provide the Camel-based URL and, if
262+
necessary, coerce the response from an specific type to String.
263+
264+
In some cases it may also be necessary to implement your own `Client` or `Resource` consumer.
265+
In those cases, then you also need to write a class that leverages [Apache Camel's](http://camel.apache.org) `ProducerTemplate`
266+
and (or, sometimes, both) `ConsumerTemplate` to interact with the system you are implementing connectivity too.
267+
268+
### Implementing Services in Other Languages
269+
270+
The communication between Wanaku MCP Router and its downstream services is capable of talking to any type of service using gRPC,
271+
therefore, it's possible to implement services in any language that supports it.
272+
273+
For those cases, leverage the `.proto` files in the `core-exchange` module for creating your own service.
274+
275+
**NOTE**: at this time, Wanaku is being intensively developed, therefore, we cannot guararantee backwards compatibility of the protocol.
276+
277+
**NOTE**: for Java, you can still generate the project using the archetype, but in this case, you must implement your own
278+
delegate from scratch.
279+

0 commit comments

Comments
 (0)