Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

feat: Swagger Connector #99

Closed
wants to merge 1 commit into from
Closed

Conversation

zregvart
Copy link
Member

Adds a Initial implementation of a Connector that uses Swagger
specification to invoke REST services.

Fixes #96

@zregvart zregvart added this to the Sprint 19 milestone Oct 26, 2017
@zregvart zregvart force-pushed the issues/96 branch 2 times, most recently from fc0b6ec to 65baf01 Compare October 31, 2017 17:59
@davsclaus
Copy link
Contributor

Ah yeah I can see the problem. You need to determine the headers in the createEndpoint method. And then you have trouble to set those headers before calling the producer.

We have some support for this by using a Processor and set that as setBeforeProducer in the component class. Then this processor will be invoked before the producer. However this processor is shared, and therefore you cannot store local state such as the headers.

So we should make it possible to set a instance of BeforeProducer on the endpoint, so you can do it all from the createEndpoint class.

Then you just set

 Map headers = ... determineHeaders
 endpoint.setBeforeProducer(e -> e.getIn().setHeaders(headers));

@davsclaus
Copy link
Contributor

I logged a ticket: https://issues.apache.org/jira/browse/CAMEL-11975

And there is a commit
apache/camel@ceb8669

Now you can do what I do in that FooComponent in the createEndpoint method of your connector. You should just use setBeforeProducer instead.

Adds a Initial implementation of a Connector that uses Swagger
specification to invoke REST services.

Fixes syndesisio#96
@zregvart
Copy link
Member Author

Moved to syndesisio/syndesis#397

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants