Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrized Backend Calls do not work #452

Open
freboy opened this issue Sep 12, 2022 · 5 comments
Open

Parametrized Backend Calls do not work #452

freboy opened this issue Sep 12, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@freboy
Copy link

freboy commented Sep 12, 2022

Describe the bug
I have a backend service as data source which takes parameters as input. I tried to use this backend as data source in my provider, following the examples here: https://international-data-spaces-association.github.io/DataspaceConnector/CommunicationGuide/v6/Parametrization but the parameters are not considered

To Reproduce
Steps to reproduce the behavior:

  1. Go to "backend connections" in DSC UI for the provider DSC
  2. Click on "Add backend connection"
  3. Create a new resource, specify the base url of the backend as URL (myhost/api/v1/get-data)
  4. Use that backend in a resource offering
  5. Do the contract negotiation and normal data request sequence from the consumer URL
  6. Request the data with additional parameters (api/artifacts/b22435d6-0469-4602-a6dc-ebb4b17bbcf0/data/?type=myfilter) from consumer DSC
  7. Expectation: Provider DSC adds parameters to request so that resulting URL is (myhost/api/v1/get-data/?type=myfilter), but only base URL is used

Expected behavior
Consumer DSC adds the additional parameters to the request, provider DSC considers them and returns specified data.

Seen error behavior
Provider DSC always just uses base url and does not consider additional parameters. When the backend URL has mandatory parameters it actually fails during contract negotiation already as the provider DSC seems to query the (invalid) base URL in this step

Screenshots & Logs
Logs available on request

Desktop (please complete the following information):

  • Version DSC 8.0.1, DSC-UI dataspace-connector-ui:10.0.1
@SebastianOpriel SebastianOpriel added the bug Something isn't working label Sep 16, 2022
@omarsilva1
Copy link

It seems that the functionality of querying with parameters isn't supported for routes backends.
As a quick fix, you can manually create an artifact in the swagger-ui and set the desired backend API as accessUrl (no routes). Parametrization works in this case.

@SebastianOpriel
Copy link
Member

For documentation: @freboy provided detailed logs to @omarsilva1 and me on 22-09-12 16:57 via mail.

@freboy
Copy link
Author

freboy commented Sep 19, 2022

As a quick fix, you can manually create an artifact in the swagger-ui and set the desired backend API as accessUrl (no routes). Parametrization works in this case.

I can confirm that using this workaround works. Is it possible to add querying with parameter to the route based solution?

@SebastianOpriel
Copy link
Member

We are investigating on how to implement the parametrization into Camel. After investigation, we will provide feedback on how to proceed.

@omarsilva1
Copy link

As a quick fix, you can manually create an artifact in the swagger-ui and set the desired backend API as accessUrl (no routes). Parametrization works in this case.

I can confirm that using this workaround works. Is it possible to add querying with parameter to the route based solution?

public Response get(final URL accessUrl, final QueryInput input) throws DataRetrievalException {

The RouteDataRetriever does get the passed QueryInput but doesn't use it in the method. Since the ProducerTemplate
uses the routeId to get the data, I don't believe it is possible to add a query to the URL, since it is already defined when creating the data offer.

final var result = template.send(camelDirect,
ExchangeBuilder.anExchange(context).build());

Note that the camelDirect ist the routeId with a prefix and not an URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants