You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ganga_camel <ga...@gmail.com> on 2016/10/14 12:59:47 UTC

Rest DSL with restlet Component, unable to access API when hosted on remote server

Hi,I have a camel route with Rest DSL using the restlet component,
configuration as listed
belowrestConfiguration().component("restlet").host("{{hostname}}").port("{{port}}")               
.dataFormatProperty("prettyPrint", "true");       
rest("/books").consumes(MediaType.ALL.toString())               
.produces(MediaType.ALL.toString())               
.post().to("direct:ProcessData");When I run the camel service on my local
machine with port as anything other than 8080(eg: 9091, 8081 etc....), I am
able successfully post to the Rest API.However, when I deploy the rest API
code on the remote server to listen on port 9091 or 8081 etc... (anything
other than port 8080), I am unable to post to the rest API. But am able to
successfully post to rest API deployed on remote server when the port is set
to 8080.This behavior is observed only when the rest API is deployed on
remote host but works fine with any port number when rest API is running on
the local machine.Any suggestions would be highly appreciated.Thanks,Ganga 



--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-with-restlet-Component-unable-to-access-API-when-hosted-on-remote-server-tp5788789.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Rest DSL with restlet Component, unable to access API when hosted on remote server

Posted by Claus Ibsen <cl...@gmail.com>.
What Camel version are you using?
And have you tried with a newer version?

Also its easy to try another rest component such as jetty or
netty4-http etc instead of restlet just to see if you can access on
that port then.

But the other suggestions about firewall and network is a very good
start to look also.

On Fri, Oct 14, 2016 at 2:59 PM, ganga_camel <ga...@gmail.com> wrote:
> Hi,I have a camel route with Rest DSL using the restlet component,
> configuration as listed
> belowrestConfiguration().component("restlet").host("{{hostname}}").port("{{port}}")
> .dataFormatProperty("prettyPrint", "true");
> rest("/books").consumes(MediaType.ALL.toString())
> .produces(MediaType.ALL.toString())
> .post().to("direct:ProcessData");When I run the camel service on my local
> machine with port as anything other than 8080(eg: 9091, 8081 etc....), I am
> able successfully post to the Rest API.However, when I deploy the rest API
> code on the remote server to listen on port 9091 or 8081 etc... (anything
> other than port 8080), I am unable to post to the rest API. But am able to
> successfully post to rest API deployed on remote server when the port is set
> to 8080.This behavior is observed only when the rest API is deployed on
> remote host but works fine with any port number when rest API is running on
> the local machine.Any suggestions would be highly appreciated.Thanks,Ganga
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-with-restlet-Component-unable-to-access-API-when-hosted-on-remote-server-tp5788789.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Rest DSL with restlet Component, unable to access API when hosted on remote server

Posted by Jonas Koperdraat <jo...@jonaskoperdraat.nl>.
The first thing that comes to my mind is CORS (cross origin resource
sharing) headers, but I'm not sure whether the restlet component adheres to
those..

On Fri, Oct 14, 2016, 15:21 Steve Huston <sh...@riverace.com> wrote:

> Sounds like a firewall (or similar) configuration issue.
>
> If not, please try posting more about what's not working - error messages,
> etc.
>
> -Steve
>
> > -----Original Message-----
> > From: ganga_camel [mailto:ganga.db@gmail.com]
> > Sent: Friday, October 14, 2016 9:00 AM
> > To: users@camel.apache.org
> > Subject: Rest DSL with restlet Component, unable to access API when
> hosted
> > on remote server
> >
> > Hi,I have a camel route with Rest DSL using the restlet component,
> > configuration as listed
> > belowrestConfiguration().component("restlet").host("{{hostname}}").port("
> > {{port}}")
> > .dataFormatProperty("prettyPrint", "true");
> > rest("/books").consumes(MediaType.ALL.toString())
> > .produces(MediaType.ALL.toString())
> > .post().to("direct:ProcessData");When I run the camel service on my local
> > machine with port as anything other than 8080(eg: 9091, 8081 etc....), I
> am
> > able successfully post to the Rest API.However, when I deploy the rest
> API
> > code on the remote server to listen on port 9091 or 8081 etc... (anything
> > other than port 8080), I am unable to post to the rest API. But am able
> to
> > successfully post to rest API deployed on remote server when the port is
> set
> > to 8080.This behavior is observed only when the rest API is deployed on
> > remote host but works fine with any port number when rest API is running
> > on the local machine.Any suggestions would be highly
> > appreciated.Thanks,Ganga
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Rest-DSL-
> > with-restlet-Component-unable-to-access-API-when-hosted-on-remote-
> > server-tp5788789.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>

RE: Rest DSL with restlet Component, unable to access API when hosted on remote server

Posted by Steve Huston <sh...@riverace.com>.
I would start by chasing this as a firewall/routing problem with your network infrastructure people.

> -----Original Message-----
> From: ganga_camel [mailto:ganga.db@gmail.com]
> Sent: Friday, October 14, 2016 9:37 AM
> To: users@camel.apache.org
> Subject: RE: Rest DSL with restlet Component, unable to access API when
> hosted on remote server
> 
> This is the error message that I get
> 
> Could not get any response
> There was an error connecting to
> http://<remoteserver>:8081/bnt?9780226519791,9780415762564.
> 
> Why this might have happened:
> The server couldn't send a response:
> Ensure that the backend is working properly SSL connections are being
> blocked:
> Fix this by importing SSL certificates in Chrome Cookies not being sent:
> Use the Postman Interceptor extension
> Request timeout:
> Change request timeout in Settings > General
> 
> Thanks,
> Ganga
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-
> with-restlet-Component-unable-to-access-API-when-hosted-on-remote-
> server-tp5788789p5788794.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Rest DSL with restlet Component, unable to access API when hosted on remote server

Posted by ganga_camel <ga...@gmail.com>.
This is the error message that I get

Could not get any response
There was an error connecting to
http://<remoteserver>:8081/bnt?9780226519791,9780415762564.

Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
SSL connections are being blocked:
Fix this by importing SSL certificates in Chrome
Cookies not being sent:
Use the Postman Interceptor extension
Request timeout:
Change request timeout in Settings > General

Thanks,
Ganga



--
View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-with-restlet-Component-unable-to-access-API-when-hosted-on-remote-server-tp5788789p5788794.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Rest DSL with restlet Component, unable to access API when hosted on remote server

Posted by Steve Huston <sh...@riverace.com>.
Sounds like a firewall (or similar) configuration issue.

If not, please try posting more about what's not working - error messages, etc.

-Steve

> -----Original Message-----
> From: ganga_camel [mailto:ganga.db@gmail.com]
> Sent: Friday, October 14, 2016 9:00 AM
> To: users@camel.apache.org
> Subject: Rest DSL with restlet Component, unable to access API when hosted
> on remote server
> 
> Hi,I have a camel route with Rest DSL using the restlet component,
> configuration as listed
> belowrestConfiguration().component("restlet").host("{{hostname}}").port("
> {{port}}")
> .dataFormatProperty("prettyPrint", "true");
> rest("/books").consumes(MediaType.ALL.toString())
> .produces(MediaType.ALL.toString())
> .post().to("direct:ProcessData");When I run the camel service on my local
> machine with port as anything other than 8080(eg: 9091, 8081 etc....), I am
> able successfully post to the Rest API.However, when I deploy the rest API
> code on the remote server to listen on port 9091 or 8081 etc... (anything
> other than port 8080), I am unable to post to the rest API. But am able to
> successfully post to rest API deployed on remote server when the port is set
> to 8080.This behavior is observed only when the rest API is deployed on
> remote host but works fine with any port number when rest API is running
> on the local machine.Any suggestions would be highly
> appreciated.Thanks,Ganga
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Rest-DSL-
> with-restlet-Component-unable-to-access-API-when-hosted-on-remote-
> server-tp5788789.html
> Sent from the Camel - Users mailing list archive at Nabble.com.