Knotx / knotx-data-bridge

Data Bridge is an integration module that enriches Fragments with data from external sources
https://knotx.io
0 stars 8 forks source link

Enable reading parameters from payload in HTTP action #48

Closed malaskowski closed 5 years ago

malaskowski commented 5 years ago

Describe the solution you'd like Currently, HTTP Action could send parametrized service calls using placeholders replacement with values from the HTTP request (query params, headers, etc.). It could be very useful if the call could be also parametrized by the data from Fragment's payload. Example action configuration could look like this:

actions {
  user-books {
    factory = http
    config {
      endpointOptions {
        path = /api/user-books/{payload.user.userId}
        domain = localhost
        port = 3000
        allowedRequestHeaders = ["Content-Type"]
      }
    }
  }
}

Additional context Consider extending Knot.x Server Commons and implement a substitutor that can extract the value from JsonObject. Some of the logic is already implemented in the PayloadToBodyActionFactory. Maybe it could be extracted to commons and re-used?

tomaszmichalak commented 5 years ago

@marcinkp what is the status of this task?

malaskowski commented 5 years ago

This was done in #51 and #52.