How to connect to https url through Apache camel? - apache-camel

I have a rest service url with https connection, how to connect to it as an endpoint using apache camel?

For simple http link : http://camel.apache.org/http4.html
If you want to use the rest dsl : http://camel.apache.org/rest-dsl.html
Typing on google "apache camel 'technology'" you'll certainly got more in depth answer.

Related

how can listen to http and https requests with julia

I want to set up a telegram webhook and I need to receive https requests.
How can I make my ip an accessible url?
I was doing this in Python with aiohttp.
You should configure Apache web server or Nginx as a web proxy and run it with Genie.jl as a backend.
According to the Telegram webhook documentation https://core.telegram.org/bots/webhooks you need to provide an SSL server (so you will need certificate etc.). While HTTP.jl provides some SSL listen capability, almost in any integration scenario I can think of you will end up needing some options that only robust servers such as Apache or Nginx can support.
Similarly, you want to have Genie.jl as a backend of the Apache/nginx proxy (rather than HTTP.jl) - as this is a standard integration scenario for webservices in Julia and this is a higher level interface than HTTP.jl with error handling for production systems etc. You can find a detailed tutorial for Nginx setup with Genie.jl here: https://genieframework.github.io/Genie.jl/dev/tutorials/92--Deploying_Genie_Server_Apps_with_Nginx.html if you are experienced with Apache you will not have problems applying the same approach to Apache web server
Try HTTP.jl, you can start from these examples.

Can I change the API url of a third Party API?

I want to request a third party API on Web APP. The API example is https://api.pinesapsapi.com/request.
Can I change the URL and build a different URL with any of the external platforms or AWS?
The basic reason of the URL changing is to keep the API Url private with my developers.
Is this possible?
For Example:
https://api.pinesapsapi.com/request should look something like https://api.xhatdffsdkj.com/request or any other generic URL
If you're looking for an AWS service to specifically do this your best best would be using API Gateway.
Configure a REST API that uses a single method of /{proxy+} and configure it with HTTP_PROXY. You can then add a custom domain name to your API Gateway setup and have it proxy to this other other domain.
Alternatively you would be looking at using a proxy based solution to forward the requests to the endpoint (such as NGINX or HAProxy running on a host such as EC2).

How to specify host port in camel restlet route DSL?

I need to add the basic authentication for a camel web project, which I use the camel restlet component to expose the REST apis, from the camel documentation Restlet Endpoint with Authentication,
An approach is to use the "restletRealm" setting, I can pass the unit test actually, but encounter the problem when integrate it with the real application:
if I add the host/port in the route DSL, like <from uri="restlet:http://localhost:8080/securedOrders?restletMethod=post&restletRealm=#realm"/>
this will cause the Address already in use error when tomcat startup
If I configure the route DSL like <from uri="restlet:/securedOrders?restletMethod=post&restletRealm=#realm"/>, this will blocking the route process.
Another approach is use the SSL support after camel 2.15.0, but still have the issue about add the host/port to the route DSL.
Any help? Thanks in advance!
ENV:
Camel: 2.15.2
Camel-Restlet: 2.15.2
Spring: 3.2.10.RELEASE

API For REST Request From NodeJS to Backend

I have an application in which angular sends the data to nodejs and nodejs send it to the backend which is running in Jetty.Can anyone suggest what would be the best API/approach to send REST request from NodeJs to Backend?
You probably don't want to sister your jetty api in node (endpoint for endpoint). You probably want to handle all requests that match a certain path, say /api and then pass those on to jetty. That is, if you can. Maybe the jetty api is not to be directly exposed.
Either way you should use the most excellent request library to call jetty from your node endpoints:
https://github.com/request/request

Using ServiceMix to Proxy Remote Web Service

This might be obvious but i just still don't understand how i'd do it with ServiceMix :
An external web service http://mypartner.com/service/partnerService
My platform is for example http://myservicemix.com/
I'd like to use OSGI bundles
Is this what i need ? :
A cxfbc:provider (this is the one that talks to the remote service, just a wsdl in the bundle right ?)
A camel route and transformations to bridge the two
A jaxrs:server (i'd like to expose it as a REST service)
The cxfbc is a JBI component. JBI is essentially dead/legacy, so I suggest to not use that for new projects. You can read more about JBI is dead here: http://gnodet.blogspot.com/2010/12/thoughts-about-servicemix.html
So Apache ServiceMix is the server where you can host your Camel applications. So I suggest to look into how to do a webservice proxy with Camel.
For example there is an example with Camel
http://camel.apache.org/cxf-proxy-example.html
That example is OSGi ready and can be deployed in Apache ServiceMix.
Also check out some of the CXF examples that are shipped with Apache ServiceMix, in the examples directory
The Camel CXF component can do both REST and WS.
Also there is the camel-restlet component for REST support as well: http://camel.apache.org/restlet

Resources