Telend ESB unique message id - http

I search Talend documentation, but maybe I overlook something. I have route that receive http request and I want to get that request message ID. Maybe it is in some property, but how I can get it? It can't be so difficult than WSO2 or Mule.

You should have a look at the Camel documentation instead :
http://camel.apache.org/simple.html
${id} will give you the ID that Camel has given to the incoming message

Related

Camel how to bypass request header from entering to http dsl component request?

I'm having a following problem with camel http requests. I would want to preserve a value of url query string parameter without passing it to another http request that needs to be done on the route. The value is needed after the http request to external api to process the data. Below is a clarification of the problem:
rest("/api")//We get requests as /camel/api?param1=xyz...
.get()
.route()
.setHeader(Exchange.HTTP_METHOD, constant("GET"))
.setHeader("Accept-Encoding", constant("gzip"))
.setHeader("Accept", constant("*/*"))
.removeHeader(Exchange.HTTP_URI)//Remove this
//How do I prevent the {header.param1} from being passed to the following http request but still be able to use it after the request on the route?
.to("https://someapi.org/api/...")
//To process the result, we need the original {header.param1} value from the request to this /camel/api endpoint
.endRest();
What is the correct way to achieve this?
If you receive parameters that are only needed in the current route and should not be passed on to any other endpoints, you can also copy them over to Exchange properties and delete the headers.
In contrast to message headers, the Camel Exchange properties are not propagated to routings and they are removed together with the Exchange when the message reaches an end of the current route.
.setProperty("param1", header("param1")) // create property from header
.removeHeader("param1") // remove the header
This is a very explicit and transparent way to do this, but you have to do it everywhere you need it. So it is good for exceptional cases that you want to make explicit.
On the other hand a HeaderFilterStrategy prevents sending specific headers (based on patterns) to the endpoints you configure it. So it is very good for general header rules you want to apply to all endpoints of a specific type (for example to all HTTP endpoints).

How to get RouteId for my getroute request?

I have Freemium plan on HERE and I'm using routing REST service.
When I request a detailed car route between two way points with a getroute request https://route.api.here.com/routing/7.2/getroute.json?app_id=APPID&app_code=APPCODE&waypoint0=geo!47.4183889,9.7318127&waypoint1=geo!47.4315312,9.8954753&mode=fastest;car;traffic:disabled, I have to set routeId parameter, otherwise I will receive an error "Parameter \"routeid\" is not specified".
How can I get my routeId? I expected I will receive it with a calculateroute results, but it is not in the json response.
Hi getRoute request is used to retrieve more information about a previously calculated route. So, routeId must be available to you as part of your earlier calculateRoute response. For getting the routeId, you must specify routeAttributes to routeId "&routeattributes=ri". Please see the documentation here (routeAttributes) -

WSO2 ESB - HTTP 401 Unauthorized Error

I have been creating a Proxy service using service chaining mechanism.
1. First I make a call to an endpoint, get the result and send the result to a sequence.
2. In the sequence, I have a data mapper and then a property to specify the username and password to a secure endpoint and then send mediator to call an endpoint.
However, I have been getting the following error:
HTTPSender Unable to sendViaPost to url[endpoint Url] org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized,
With the description as "This request requires HTTP authentication"
The solution I have tried:
1. Tried adding a property "FORCE_HTTP_1.0" to true before making a call to the endpoint.
But nothing seems to work. Any help would be appreciated.
Thanks in advance.
If your backend requires Basic authentication, set the following property before your backend call.
Mmh seems like it's not possible to paste Code from my iPhone. Hope the link works.
https://docs.wso2.com/display/ESB470/Enabling+HTTP+Basic+Authentication+through+a+Proxy+Server
Just set the property "Proxy-Authorization"

Interrogate the URL hash fragment on inbound Mule HTTP endpoint

I've setup a Mule ESB flow, with an inbound HTTP endpoint; to which I'm posting:
GET http://myserver/myurl#blah=xxx
However, i can't find the blah=xxx referenced in any inbound properties. Does Mule support this notation? And how do i get reference to this fragment?
All Inbound properties i've seen don't have the hash fragment.
What I know, using hash is to identify a portion in a document, however what you're trying to do is more similar to using query parameters
GET http://myserver/myurl?blah=xxx
Then reference it in mule using MEL expression:
#[message.inboundProperties.'http.query.params'.blah]
Cheers

how do i resend a request after processing it inside my apigee endpoint

I have a endpoint called get user data which accepts a token
I need to read this token in my apigee and send it to tokenVarificationExtUrl
which gets back to me with
a) valid 200
b) userid attached with that token
now what i have to do is i need to read the response header and then conditionally check it for 200 success and then extract the userid from the response.
Once its extracted i need to attach it with another request; which i need to send to getUserData external url
which will get back to me with required user details.
I am successful of extracting data and doing conditional check. I am seeking help for
how do i send another request to getUserData external url.
You need to use a few policies in your proxy.
For example
For checking a header and throwing an error, you may want to use rasie fault policy conditionally
For making an API call to external end-point you can use service callout policy or a standard target
For exrtacting response data from json or xml payload you can use json path of xpath policies
and so on.
I suppose you may want to take a look at a few sample proxies with these functions to be able to design your own.
Check this link out. http://apigee.com/docs/content/using-sample-api-proxies

Resources