How to create API proxy in MuleSoft?
I want to use API proxy in my mule application.
MuleSoft provides some api to get data. I can't use HTTP connector with API so I need to use API proxy.
So the short answer is that you need to create a new component, and you can use something like the Mule 3.4.0 Java version of (from the Mule Cookbook) to do so.
The longer answer is that it's actually a lot more involved than that. Firstly, you need to figure out what kind of API you're working with and what platform it is. And then you need to look at the underlying protocol that Mule will be using to access that API.
If you're not going to have much in the way of custom code, then you can probably just use a HTTP connector. The Java version of this is very similar to the one referenced above. But if you want to use your own custom code, then you will have to implement this as a Flow, which means that your client needs to be configured to use the same URL as the gateway.
To start you off, you can look at the Mule documentation on how to use a HTTP connector.
What is the difference between API gateway and API proxy in Mule?
When you have an API and the client needs to make API calls to it.
You use the API Gateway component of Mule to do this.
The difference between API gateway and API proxy is that API gateway is responsible for sending all the calls to your service. The client just submits an HTTP post request with form parameters to an URL in API Gateway which it knows where the service is hosted.
On the other hand, the API proxy is responsible for just forwarding these requests to the right endpoint. The flow looks like: I have a situation where the API gateway has one end point whereas many endpoints are in the service which the API gateway sends request to it. It will be appreciated if anyone could provide some information on this. The purpose of a proxy is to transform the message data and headers, and forward them to their destination(s). So in essence, it's just a regular gateway without message transformation capabilities. When it's configured as proxy for something, it's able to understand the different urls it's connected to (as destinations), and is in charge of routing the data based on the uri passed in the payload/headers/etc.
If you want to transform the uri, payload or headers, for example to get rid of "login" in header names, you have the option to use a filter or regular expression extractor. For example:
Related Answers
What language is used in MuleSoft?
Here are the main ways it can be used: Mobile/Web Apps - MuleSoft can hel...
What is the difference between API Manager and API gateway?
MuleSoft API Manager is a service to help you define and run API inte...
What is MuleSoft Flex Gateway?
This topic outlines the minimum and recommended. requir...