Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Api Management and routes

Hi all, 
I have a route that's calling a Rest Web service. (see in my little drawing Smiley Tongue)
I have 2 questions please: 
1: what it's wrong with the el exptression I'm using, I retrieve a json data; whan I use a "rout" link between the cMessageRouter and the cProcessor, everything works just fine, but when I try to filter the output, it doesn't work, I also tried the type "simple".
2: how can I  "call the route from an API Manager" (the green part in the drawing )if I can say it this way? is there a component that has to be added to the route? 
If I consume the Rest web service directly, I juste have to use the URL, put it in the API Manager. Now that I'm using the bus, I'm a little confused. 
Thank you for your time
-Regards  
Labels (4)
20 Replies
Anonymous
Not applicable
Author

If I understand you correctly, without Talend you are communicating with APIMAN using a REST service. If that is the case you can do that with Talend using the cHttp component. It needs to be configured to call the APIMAN REST service and supply the JSON string that you have in your Exchange In body. 
Anonymous
Not applicable
Author

the point is that it's APIMAN that should call talend (the route), not the opposite.
Yes apiman is a rest service, but it's used to expose other web services.  
The communication with APIMAN is done only using a URL, so is there anyway that the output of the route can be accessible/consumed using a "localhost:/....", if yes, that would solve my probleme. 
Anonymous
Not applicable
Author

So you are not wanting the route to call APIMAN. You do realise that a route does not work in the same way as a service. You do not "call" a route. A route does a job. It is triggered by an action, but you do not "call" the result. The result is delivered. It is "pushed". What you can do is "push" that result into a queue (or something similar) and then create a web service that can be called by APIMAN to retrieve the message. But you cannot have a route triggered and for it to simply hold on to the result until it is a called by something. 
The best case I can think of for what I know now would be to use an ActiveMQ and simply dump the messages into the queue at the end of the route. With a route the messages have to go somewhere. For that use case, you need to push them to a queue or maybe to a database. If you are wanting to put them in a queue to be consumed by APIMAN then you will need to use a cJMS component. However you will need to have a mechanism for getting them from the queue to APIMAN if it doesn't already support that mechanism.
Saying that APIMAN consumes messages using "localhost:" means absolutely nothing I am afraid. You need to let us know what protocol is used, what is consumed, how often it is consumed, what is happening? 
Anonymous
Not applicable
Author

Okey, thank you 
I'll try to do some readings about apiman
Anonymous
Not applicable
Author

I reconsidered the problem, and I thought about a different manner to connect apiman and talend. 
1. create a job   :   tRouteInput-->tRestRequest-->tlog
2. create a route:                   cTimer-->chttp-->cTalendJob (assigned to the job bellow)
Apiman will call the job, that call will trigger the route (since the job is assigned to it), and the route will act on my service web. 
what do you think plz?
Thank you 
Anonymous
Not applicable
Author

The cTalendJob is attached to the Route. They are used to process Route messages. Your job will need to receive the Route message with a tRouteInput and return the message with a tRouteOutput. But I don't believe your thinking will work here. The cTalendJob is called by the Route. It doesn't start the Route.
Can you get APIMAN to call a service of any kind? How can APIMAN communicate with other systems (API, REST, SOAP, Flat file, etc)?
Anonymous
Not applicable
Author

1. yes, I got Apiman to call a Rest job that I've created using TOS. 
2.  Out of the box, apiman listens on HTTP and communicates with back-end services also on HTTP.
here's a simple view of the architecture of apiman:
**APIManager backend: It exposes a set of REST interfaces for managing the APIs. It is the one holding the API Management information (data model). Every time an API has to be published, it communicates via REST with the APIGAteway Config.
**APIGateway Config: It is the layer for managing an APIGateway. It exposes a REST interface for management, and stores the management/configuration state.
**APIGateway Runtime: The APIGateway Runtime will be primary runtime component of apiman, and will proxy requests from consumers to the services, applying a set of policies for delivering the service. This is the endpoint that will be known by applications. This will be the single source of requests to the services (APIs).
Anonymous
Not applicable
Author

OK, here is my suggestion....
Create a Route where the first component is a cHttp component set up as "server". This can be callled by APIMAN and will act as the action to trigger the Route. This route will also call a cHttp component set up as a "client", used to call the service that you need to call.
cHttp(Server - Called by APIMAN)--> cProcessor (Do something, anything)-->cHttp(Client - Call your REST service)-->cProcessor(etc)
The cHttp (Server) is called by APIMAN
The cProcessor can do something with the message (not necessary, but may be useful)
The cHttp (Client) is used to call your REST service
The last cProcessor is used to process the response from the REST service call
After this you could have a cTalendJob to do something with the message like send it to a DB, whatever you want.
Take a look here for how to use the cHttp component
Anonymous
Not applicable
Author

Good morning, 
Thank you for your suggestion, I'll give it a try 
Anonymous
Not applicable
Author

it works like a charm 
thank you very much Smiley Very Happy