You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yvsandeep <sa...@bt.com> on 2013/09/02 14:57:58 UTC

Help required with Camel for HTTP service.

Hi,

I am new to Apache Camel.I am trying to create a HTTP ping-pong service
using Apache Camel.Here is the flow.

 HTTP Client <-> Apache Camel <-> HTTP Webserver

Here are the programs that I am using.

Main pgm
-----------
import org.apache.camel.spring.Main;

public class Test 
{

	public static void main(String[] args) throws Exception  
	{
		Main start = new Main();
		start.enableHangupSupport();
		System.out.println("Starting the listener....");
		start.run(); 
		System.out.println("Exit");
	}

}

Routes
--------
import org.apache.camel.builder.RouteBuilder;

public class HTTPListener extends RouteBuilder {

	@Override
    public void configure() throws Exception 
    {
		System.out.println("Routing....");
	
from("jetty:http://0.0.0.0:61000/myapp/myservice").to("jetty://http://remoteIP:61050/Dummy");
    }

}

I have posted the message to /myapp/myservice.However,I do not see the
request being routed to the remote http web server.Also,what should I do to
get the response from the web server and send it to the http client?



--
View this message in context: http://camel.465427.n5.nabble.com/Help-required-with-Camel-for-HTTP-service-tp5738518.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help required with Camel for HTTP service.

Posted by yvsandeep <sa...@bt.com>.
Hi,

I have checked the backend server.It is running.I am able to post the
message to the backend successfully directly from the same http client. 



--
View this message in context: http://camel.465427.n5.nabble.com/Help-required-with-Camel-for-HTTP-service-tp5738518p5738558.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help required with Camel for HTTP service.

Posted by Christian Posta <ch...@gmail.com>.
Maybe you can try a curl command on the remoteIP endpoint to make sure it's
responding?


On Mon, Sep 2, 2013 at 8:10 AM, yvsandeep <sa...@bt.com> wrote:

> Hi,
>
> Thank you for clarifying on the jetty component.This application will start
> off as a proxy service doing nothing but passing the requests/responses
> between the clients and servers.We will add additional functionality such
> as
> XML transformation etc in future.
>
>   Yes,I do see the debug messages being printed out.I am using Jmeter to
> post messages to Camel.I get an exception in Jmeter telling that the remote
> host has not responded.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Help-required-with-Camel-for-HTTP-service-tp5738518p5738522.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: Help required with Camel for HTTP service.

Posted by yvsandeep <sa...@bt.com>.
Hi,

Thank you for clarifying on the jetty component.This application will start
off as a proxy service doing nothing but passing the requests/responses
between the clients and servers.We will add additional functionality such as
XML transformation etc in future.

  Yes,I do see the debug messages being printed out.I am using Jmeter to
post messages to Camel.I get an exception in Jmeter telling that the remote
host has not responded.



--
View this message in context: http://camel.465427.n5.nabble.com/Help-required-with-Camel-for-HTTP-service-tp5738518p5738522.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help required with Camel for HTTP service.

Posted by Christian Posta <ch...@gmail.com>.
The jetty component is by default in-out.. so there isn't anything special
you need to do to get the response from remoteIP to get sent back to the
calling HTTP client. The real question here is, what does this do? Do you
see your debug statements printing out ("Routing....")? Do you see any
exception stack traces?


On Mon, Sep 2, 2013 at 5:57 AM, yvsandeep <sa...@bt.com> wrote:

> Hi,
>
> I am new to Apache Camel.I am trying to create a HTTP ping-pong service
> using Apache Camel.Here is the flow.
>
>  HTTP Client <-> Apache Camel <-> HTTP Webserver
>
> Here are the programs that I am using.
>
> Main pgm
> -----------
> import org.apache.camel.spring.Main;
>
> public class Test
> {
>
>         public static void main(String[] args) throws Exception
>         {
>                 Main start = new Main();
>                 start.enableHangupSupport();
>                 System.out.println("Starting the listener....");
>                 start.run();
>                 System.out.println("Exit");
>         }
>
> }
>
> Routes
> --------
> import org.apache.camel.builder.RouteBuilder;
>
> public class HTTPListener extends RouteBuilder {
>
>         @Override
>     public void configure() throws Exception
>     {
>                 System.out.println("Routing....");
>
> from("jetty:http://0.0.0.0:61000/myapp/myservice").to("jetty://
> http://remoteIP:61050/Dummy");
>     }
>
> }
>
> I have posted the message to /myapp/myservice.However,I do not see the
> request being routed to the remote http web server.Also,what should I do to
> get the response from the web server and send it to the http client?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Help-required-with-Camel-for-HTTP-service-tp5738518.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta