Imagine you have an application (let's call it B) with an inbound HTTP interface (using HTTP is a requirement). You will call it from several different other applications in the future but at the moment you only want to develop a single client (let's call it A). So in A, there is an outbound HTTP gateway:
A (outbound gateway) ---[HTTP]---> (inbound gateway) B
Is it possible to share code e.g. the HTTP API definition like path (for example "/hello"), method (GET, POST, PUT...), maybe parameters/their type/response between these two apps? If yes, how?
I would like to use the Java DSL but I see that Http.inboundGateway("..")
and Http.outboundGateway("..")
are totally different (e.g. the type) so I am not sure. Ideally I could have something like:
@Bean
public IntegrationFlow inbound() {
return IntegrationFlows.from(apiDefinition)...
.get();
...
...
@Bean
public IntegrationFlow outbound() {
return IntegrationFlows.from(somehwere)...
.handle(with(apiDefinition))
.get();
Api Definition can be imagined like the following (pseudocode):
apiDefinition =
method: GET
path: /items/{id}
parameters:
id: string
response: item