You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by GLD <gu...@orange-ftgroup.com> on 2008/10/21 10:29:52 UTC

CAMEL Servlet Endpoint

Hi all,

I want to embed Camel in a WebApp.  The web app will be hosted in an
application server like JONAS (/tomcat or JETTY) or Weblogic.

I want to create a route like this
  <from   [MY CONSUMER ENDPOINT]  />
  <process ref="myProcessor" />
  <to [MY PRODUCER ENDPOINT] />

As camel is embedded in a webapp, I want to use the web container of the
application server to listen to http request ( I.E, I want to configure a
servlet to listen httpRequests and send back httpResponses).

Reading the doc, I didn't find the way to do this.
In examples, consumers are jetty or CXF but It seems they re create another
http listener and I don't want it.

I looked at the Axis example, It uses a ProducerTemplate
It is interesting but I don't know if I can use this kind of Producer
template to identify the [from] endpoint of a route.

The Second part of the question is how do I create a route for the response
received from my [MY PRODUCER ENDPOINT]

Regards, guillaume 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20085692.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CAMEL Servlet Endpoint

Posted by cmoulliard <cm...@gmail.com>.
Guillaume,

Have you had a look to the ajax component of activemq
(http://activemq.apache.org/ajax.html). It allows you to create real-time
application based on AJAX javascript at the client side and jms queues at
the server side. Each time a message (for which the client has subscribed
through a topic by example) is placed in the queue, the poll mechanism
implemented through the Continuation servlet of Jetty will allow the client
after x seconds to receive the message. For more information, please have a
look to the page mentioned.

Remark : I'm currently working on a small Proof Of Concept extending the
existing portfolio sample with Camel in order to provide messages on the bus
instead of the PortfolioServlet generating randomly stock prices.

KR,

Charles 

GLD wrote:
> 
> Hi all,
> 
> I want to embed Camel in a WebApp.  The web app will be hosted in an
> application server like JONAS (/tomcat or JETTY) or Weblogic.
> 
> I want to create a route like this
>   <from   [MY CONSUMER ENDPOINT]  />
>   <process ref="myProcessor" />
>   <to [MY PRODUCER ENDPOINT] />
> 
> As camel is embedded in a webapp, I want to use the web container of the
> application server to listen to http request ( I.E, I want to configure a
> servlet to listen httpRequests and send back httpResponses).
> 
> Reading the doc, I didn't find the way to do this.
> In examples, consumers are jetty or CXF but It seems they re create
> another http listener and I don't want it.
> 
> I looked at the Axis example, It uses a ProducerTemplate
> It is interesting but I don't know if I can use this kind of Producer
> template to identify the [from] endpoint of a route.
> 
> The Second part of the question is how do I create a route for the
> response received from my [MY PRODUCER ENDPOINT]
> 
> Regards, guillaume 
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20087686.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CAMEL Servlet Endpoint

Posted by GLD <gu...@orange-ftgroup.com>.
Great. 
I will use the solution proposed in the faq. 
Thaks for the quick reply.

guillaume


Claus Ibsen wrote:
> 
> Hi
> 
> Glad its working.
> 
> The spring property stuff is known, and we have a FAQ entry:
> http://activemq.apache.org/camel/how-do-i-use-spring-property-placeholder-with-camel-xml.html
> 
> 
> It's actually some limitations in Spring. Should be on the roadmap for
> Spring 3.0. There is a JIRA in spring filed by James Strachan about this.
>  
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: GLD [mailto:guillaume.lundy@orange-ftgroup.com] 
> Sent: 24. oktober 2008 10:22
> To: camel-user@activemq.apache.org
> Subject: RE: CAMEL Servlet Endpoint
> 
> 
> Thanks a lot Claus, I can inject my data received from my servlet.
> 
> I just notice a bug but I don't know if it comes from  spring or camel.
> I tried to use a spring placeholder in the cal tag "to" 
>     <to uri=${my.uri} /> 
> The resolution has not been done.
> It seems to be because "to" is not a spring tag but a camel tag.
> (It works in spring tags)
> 
> I think I found a work around : 
>    I created a EnpointHolderClass that contains 
>      - a constructor with args CamelContext and Uri (string) 
>      - a private member Endpoint and its getter and setter.
> 
> in spring, I declare my bean myEndPointHolder (class EndPointHolder), and
> use spring <constructor-args> to set the uri and camel context
> The contructor performs a camelContext.getEndpoint(uri);
>     
> 
> I declare an other bean id="myEndpoint" using attributes Factory-bean
> name="myEndPointHolder" and factory-method="getEndpoint"
> 
> 
> 
> in  the <to> tag, I can refer my endpoint <to ref="myEndpoint">
> 
> GLD.
> 
> 
> 
> 
> 
> 
> Claus Ibsen wrote:
>> 
>> Hi
>> 
>> You can send it to the from very easily like this
>> 
>> 
>> camelProducerTemplate.sendBody("direct:foo", "Hello World");
>> 
>> The first parameter is the URI of the endpoint, and the 2nd parameter is
>> the payload to send.
>> 
>> If you want/expect a reply, then use requestBody instead:
>> 
>> Object reply = camelProducerTemplate.requestBody("direct:foo", "Hello
>> World");
>> 
>>  
>> 
>> Med venlig hilsen
>>  
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20146182.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20146489.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CAMEL Servlet Endpoint

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Glad its working.

The spring property stuff is known, and we have a FAQ entry:
http://activemq.apache.org/camel/how-do-i-use-spring-property-placeholder-with-camel-xml.html


It's actually some limitations in Spring. Should be on the roadmap for Spring 3.0. There is a JIRA in spring filed by James Strachan about this.
 

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: GLD [mailto:guillaume.lundy@orange-ftgroup.com] 
Sent: 24. oktober 2008 10:22
To: camel-user@activemq.apache.org
Subject: RE: CAMEL Servlet Endpoint


Thanks a lot Claus, I can inject my data received from my servlet.

I just notice a bug but I don't know if it comes from  spring or camel.
I tried to use a spring placeholder in the cal tag "to" 
    <to uri=${my.uri} /> 
The resolution has not been done.
It seems to be because "to" is not a spring tag but a camel tag.
(It works in spring tags)

I think I found a work around : 
   I created a EnpointHolderClass that contains 
     - a constructor with args CamelContext and Uri (string) 
     - a private member Endpoint and its getter and setter.

in spring, I declare my bean myEndPointHolder (class EndPointHolder), and
use spring <constructor-args> to set the uri and camel context
The contructor performs a camelContext.getEndpoint(uri);
    

I declare an other bean id="myEndpoint" using attributes Factory-bean
name="myEndPointHolder" and factory-method="getEndpoint"



in  the <to> tag, I can refer my endpoint <to ref="myEndpoint">

GLD.






Claus Ibsen wrote:
> 
> Hi
> 
> You can send it to the from very easily like this
> 
> 
> camelProducerTemplate.sendBody("direct:foo", "Hello World");
> 
> The first parameter is the URI of the endpoint, and the 2nd parameter is
> the payload to send.
> 
> If you want/expect a reply, then use requestBody instead:
> 
> Object reply = camelProducerTemplate.requestBody("direct:foo", "Hello
> World");
> 
>  
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20146182.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CAMEL Servlet Endpoint

Posted by GLD <gu...@orange-ftgroup.com>.
Thanks a lot Claus, I can inject my data received from my servlet.

I just notice a bug but I don't know if it comes from  spring or camel.
I tried to use a spring placeholder in the cal tag "to" 
    <to uri=${my.uri} /> 
The resolution has not been done.
It seems to be because "to" is not a spring tag but a camel tag.
(It works in spring tags)

I think I found a work around : 
   I created a EnpointHolderClass that contains 
     - a constructor with args CamelContext and Uri (string) 
     - a private member Endpoint and its getter and setter.

in spring, I declare my bean myEndPointHolder (class EndPointHolder), and
use spring <constructor-args> to set the uri and camel context
The contructor performs a camelContext.getEndpoint(uri);
    

I declare an other bean id="myEndpoint" using attributes Factory-bean
name="myEndPointHolder" and factory-method="getEndpoint"



in  the <to> tag, I can refer my endpoint <to ref="myEndpoint">

GLD.






Claus Ibsen wrote:
> 
> Hi
> 
> You can send it to the from very easily like this
> 
> 
> camelProducerTemplate.sendBody("direct:foo", "Hello World");
> 
> The first parameter is the URI of the endpoint, and the 2nd parameter is
> the payload to send.
> 
> If you want/expect a reply, then use requestBody instead:
> 
> Object reply = camelProducerTemplate.requestBody("direct:foo", "Hello
> World");
> 
>  
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20146182.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CAMEL Servlet Endpoint

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

You can send it to the from very easily like this


camelProducerTemplate.sendBody("direct:foo", "Hello World");

The first parameter is the URI of the endpoint, and the 2nd parameter is the payload to send.

If you want/expect a reply, then use requestBody instead:

Object reply = camelProducerTemplate.requestBody("direct:foo", "Hello World");

 

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: GLD [mailto:guillaume.lundy@orange-ftgroup.com] 
Sent: 21. oktober 2008 14:37
To: camel-user@activemq.apache.org
Subject: Re: CAMEL Servlet Endpoint


Hi Claus, 
Thanks for the reply.

when you say 
> If you create your own servlets then of course you can identify it 
> and thus should know what [MY CONSUMER ENDPOINT] it is from. 
> You can get the http request and thus also the requested
> path/context/query string, etc.

>>>
in a concrete way, how should I do?
I cannot use a Bean Endpoint. what should I put in "from" tag

I created my servlet, a bean that implements the service. And I would like
to send the http body to the "from" tag of the route. could y


see attached Zip file 
http://www.nabble.com/file/p20089260/camel_question.zip camel_question.zip 


Regards.



James.Strachan wrote:
> 
> BTW the camel-http library has a Camel servlet that can be used for
> routing servlet invocations into Camel...
> http://activemq.apache.org/camel/http.html
> 
> as does the Jetty component
> http://activemq.apache.org/camel/jetty.html
> 
> 
> 2008/10/21 Claus Ibsen <ci...@silverbullet.dk>:
>> Hi
>>
>> Yeah to my knowledge this is not support in Camel. We discussed this on
>> the chat the other day. Please feel free to raise it in our bug tracker
>> (JIRA).
>>
>> If you create your own servlets then of course you can identify it and
>> thus should know what [MY CONSUMER ENDPOINT] it is from. You can get the
>> http request and thus also the requested path/context/query string, etc.
>>
>>
>>
>> Med venlig hilsen
>>
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>>
>> -----Original Message-----
>> From: GLD [mailto:guillaume.lundy@orange-ftgroup.com]
>> Sent: 21. oktober 2008 10:30
>> To: camel-user@activemq.apache.org
>> Subject: CAMEL Servlet Endpoint
>>
>>
>> Hi all,
>>
>> I want to embed Camel in a WebApp.  The web app will be hosted in an
>> application server like JONAS (/tomcat or JETTY) or Weblogic.
>>
>> I want to create a route like this
>>  <from   [MY CONSUMER ENDPOINT]  />
>>  <process ref="myProcessor" />
>>  <to [MY PRODUCER ENDPOINT] />
>>
>> As camel is embedded in a webapp, I want to use the web container of the
>> application server to listen to http request ( I.E, I want to configure a
>> servlet to listen httpRequests and send back httpResponses).
>>
>> Reading the doc, I didn't find the way to do this.
>> In examples, consumers are jetty or CXF but It seems they re create
>> another
>> http listener and I don't want it.
>>
>> I looked at the Axis example, It uses a ProducerTemplate
>> It is interesting but I don't know if I can use this kind of Producer
>> template to identify the [from] endpoint of a route.
>>
>> The Second part of the question is how do I create a route for the
>> response
>> received from my [MY PRODUCER ENDPOINT]
>>
>> Regards, guillaume
>>
>> --
>> View this message in context:
>> http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20085692.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20089260.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CAMEL Servlet Endpoint

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

About the reponse. You should not add a 2nd route for the response.

Camel will return the response as the OUT message of the exchange. So your route should just be these two lines:

<from uri="FROM_ENDPOINT" />
<process ref="myProcessor" />


And then the response is the OUT from myProcessor

Public void process(Exchange exchange) {
   String body = exchange.getIn().getBody(String.class);
   // do something with input
   String reply = "Bye World";
   exchange.getOut().setBody(reply);
   // now the reply will be Bye World as it's the OUT message
}

When using OUT it is important that you use the requestBody method (requestXXX) methods on the producer template as they are for InOut exhange patterns.



So this in your spring xml should be removed = not needed.


<!-- route for the response ??? is it correct -->
			<from uri="TO_ENDPOINT" />
			<process ref="myResponseProcessor" />
			<to uri="FROM_ENDPOINT" />


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: GLD [mailto:guillaume.lundy@orange-ftgroup.com] 
Sent: 21. oktober 2008 14:37
To: camel-user@activemq.apache.org
Subject: Re: CAMEL Servlet Endpoint


Hi Claus, 
Thanks for the reply.

when you say 
> If you create your own servlets then of course you can identify it 
> and thus should know what [MY CONSUMER ENDPOINT] it is from. 
> You can get the http request and thus also the requested
> path/context/query string, etc.

>>>
in a concrete way, how should I do?
I cannot use a Bean Endpoint. what should I put in "from" tag

I created my servlet, a bean that implements the service. And I would like
to send the http body to the "from" tag of the route. could y


see attached Zip file 
http://www.nabble.com/file/p20089260/camel_question.zip camel_question.zip 


Regards.



James.Strachan wrote:
> 
> BTW the camel-http library has a Camel servlet that can be used for
> routing servlet invocations into Camel...
> http://activemq.apache.org/camel/http.html
> 
> as does the Jetty component
> http://activemq.apache.org/camel/jetty.html
> 
> 
> 2008/10/21 Claus Ibsen <ci...@silverbullet.dk>:
>> Hi
>>
>> Yeah to my knowledge this is not support in Camel. We discussed this on
>> the chat the other day. Please feel free to raise it in our bug tracker
>> (JIRA).
>>
>> If you create your own servlets then of course you can identify it and
>> thus should know what [MY CONSUMER ENDPOINT] it is from. You can get the
>> http request and thus also the requested path/context/query string, etc.
>>
>>
>>
>> Med venlig hilsen
>>
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>>
>> -----Original Message-----
>> From: GLD [mailto:guillaume.lundy@orange-ftgroup.com]
>> Sent: 21. oktober 2008 10:30
>> To: camel-user@activemq.apache.org
>> Subject: CAMEL Servlet Endpoint
>>
>>
>> Hi all,
>>
>> I want to embed Camel in a WebApp.  The web app will be hosted in an
>> application server like JONAS (/tomcat or JETTY) or Weblogic.
>>
>> I want to create a route like this
>>  <from   [MY CONSUMER ENDPOINT]  />
>>  <process ref="myProcessor" />
>>  <to [MY PRODUCER ENDPOINT] />
>>
>> As camel is embedded in a webapp, I want to use the web container of the
>> application server to listen to http request ( I.E, I want to configure a
>> servlet to listen httpRequests and send back httpResponses).
>>
>> Reading the doc, I didn't find the way to do this.
>> In examples, consumers are jetty or CXF but It seems they re create
>> another
>> http listener and I don't want it.
>>
>> I looked at the Axis example, It uses a ProducerTemplate
>> It is interesting but I don't know if I can use this kind of Producer
>> template to identify the [from] endpoint of a route.
>>
>> The Second part of the question is how do I create a route for the
>> response
>> received from my [MY PRODUCER ENDPOINT]
>>
>> Regards, guillaume
>>
>> --
>> View this message in context:
>> http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20085692.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20089260.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CAMEL Servlet Endpoint

Posted by GLD <gu...@orange-ftgroup.com>.
Hi Claus, 
Thanks for the reply.

when you say 
> If you create your own servlets then of course you can identify it 
> and thus should know what [MY CONSUMER ENDPOINT] it is from. 
> You can get the http request and thus also the requested
> path/context/query string, etc.

>>>
in a concrete way, how should I do?
I cannot use a Bean Endpoint. what should I put in "from" tag

I created my servlet, a bean that implements the service. And I would like
to send the http body to the "from" tag of the route. could y


see attached Zip file 
http://www.nabble.com/file/p20089260/camel_question.zip camel_question.zip 


Regards.



James.Strachan wrote:
> 
> BTW the camel-http library has a Camel servlet that can be used for
> routing servlet invocations into Camel...
> http://activemq.apache.org/camel/http.html
> 
> as does the Jetty component
> http://activemq.apache.org/camel/jetty.html
> 
> 
> 2008/10/21 Claus Ibsen <ci...@silverbullet.dk>:
>> Hi
>>
>> Yeah to my knowledge this is not support in Camel. We discussed this on
>> the chat the other day. Please feel free to raise it in our bug tracker
>> (JIRA).
>>
>> If you create your own servlets then of course you can identify it and
>> thus should know what [MY CONSUMER ENDPOINT] it is from. You can get the
>> http request and thus also the requested path/context/query string, etc.
>>
>>
>>
>> Med venlig hilsen
>>
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>>
>> -----Original Message-----
>> From: GLD [mailto:guillaume.lundy@orange-ftgroup.com]
>> Sent: 21. oktober 2008 10:30
>> To: camel-user@activemq.apache.org
>> Subject: CAMEL Servlet Endpoint
>>
>>
>> Hi all,
>>
>> I want to embed Camel in a WebApp.  The web app will be hosted in an
>> application server like JONAS (/tomcat or JETTY) or Weblogic.
>>
>> I want to create a route like this
>>  <from   [MY CONSUMER ENDPOINT]  />
>>  <process ref="myProcessor" />
>>  <to [MY PRODUCER ENDPOINT] />
>>
>> As camel is embedded in a webapp, I want to use the web container of the
>> application server to listen to http request ( I.E, I want to configure a
>> servlet to listen httpRequests and send back httpResponses).
>>
>> Reading the doc, I didn't find the way to do this.
>> In examples, consumers are jetty or CXF but It seems they re create
>> another
>> http listener and I don't want it.
>>
>> I looked at the Axis example, It uses a ProducerTemplate
>> It is interesting but I don't know if I can use this kind of Producer
>> template to identify the [from] endpoint of a route.
>>
>> The Second part of the question is how do I create a route for the
>> response
>> received from my [MY PRODUCER ENDPOINT]
>>
>> Regards, guillaume
>>
>> --
>> View this message in context:
>> http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20085692.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20089260.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CAMEL Servlet Endpoint

Posted by James Strachan <ja...@gmail.com>.
BTW the camel-http library has a Camel servlet that can be used for
routing servlet invocations into Camel...
http://activemq.apache.org/camel/http.html

as does the Jetty component
http://activemq.apache.org/camel/jetty.html


2008/10/21 Claus Ibsen <ci...@silverbullet.dk>:
> Hi
>
> Yeah to my knowledge this is not support in Camel. We discussed this on the chat the other day. Please feel free to raise it in our bug tracker (JIRA).
>
> If you create your own servlets then of course you can identify it and thus should know what [MY CONSUMER ENDPOINT] it is from. You can get the http request and thus also the requested path/context/query string, etc.
>
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: GLD [mailto:guillaume.lundy@orange-ftgroup.com]
> Sent: 21. oktober 2008 10:30
> To: camel-user@activemq.apache.org
> Subject: CAMEL Servlet Endpoint
>
>
> Hi all,
>
> I want to embed Camel in a WebApp.  The web app will be hosted in an
> application server like JONAS (/tomcat or JETTY) or Weblogic.
>
> I want to create a route like this
>  <from   [MY CONSUMER ENDPOINT]  />
>  <process ref="myProcessor" />
>  <to [MY PRODUCER ENDPOINT] />
>
> As camel is embedded in a webapp, I want to use the web container of the
> application server to listen to http request ( I.E, I want to configure a
> servlet to listen httpRequests and send back httpResponses).
>
> Reading the doc, I didn't find the way to do this.
> In examples, consumers are jetty or CXF but It seems they re create another
> http listener and I don't want it.
>
> I looked at the Axis example, It uses a ProducerTemplate
> It is interesting but I don't know if I can use this kind of Producer
> template to identify the [from] endpoint of a route.
>
> The Second part of the question is how do I create a route for the response
> received from my [MY PRODUCER ENDPOINT]
>
> Regards, guillaume
>
> --
> View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20085692.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

RE: CAMEL Servlet Endpoint

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Yeah to my knowledge this is not support in Camel. We discussed this on the chat the other day. Please feel free to raise it in our bug tracker (JIRA).

If you create your own servlets then of course you can identify it and thus should know what [MY CONSUMER ENDPOINT] it is from. You can get the http request and thus also the requested path/context/query string, etc.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: GLD [mailto:guillaume.lundy@orange-ftgroup.com] 
Sent: 21. oktober 2008 10:30
To: camel-user@activemq.apache.org
Subject: CAMEL Servlet Endpoint


Hi all,

I want to embed Camel in a WebApp.  The web app will be hosted in an
application server like JONAS (/tomcat or JETTY) or Weblogic.

I want to create a route like this
  <from   [MY CONSUMER ENDPOINT]  />
  <process ref="myProcessor" />
  <to [MY PRODUCER ENDPOINT] />

As camel is embedded in a webapp, I want to use the web container of the
application server to listen to http request ( I.E, I want to configure a
servlet to listen httpRequests and send back httpResponses).

Reading the doc, I didn't find the way to do this.
In examples, consumers are jetty or CXF but It seems they re create another
http listener and I don't want it.

I looked at the Axis example, It uses a ProducerTemplate
It is interesting but I don't know if I can use this kind of Producer
template to identify the [from] endpoint of a route.

The Second part of the question is how do I create a route for the response
received from my [MY PRODUCER ENDPOINT]

Regards, guillaume 

-- 
View this message in context: http://www.nabble.com/CAMEL-Servlet-Endpoint-tp20085692s22882p20085692.html
Sent from the Camel - Users mailing list archive at Nabble.com.