You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2014/04/11 11:48:31 UTC

Re: Will web request be intercepted by CAMEL with this configuration?

Hi


On Thu, Apr 10, 2014 at 7:26 PM, scottmiles <mo...@gmail.com> wrote:
> I see below configuration at
> http://java.dzone.com/articles/open-source-integration-apache
>
> <route id="HTTPtoJMS">
>   <from uri="jetty:http://0.0.0.0:8888/placeorder" />
>     <inOnly uri="jms:incomingOrders" />
>        <transform>
>          <constant>OK</constant>
>       </transform>
> </route>
>
> Does it mean that any we request with URL http://0.0.0.0:8888/placeorder
> will be intercepted by CAMEL and  output(in the form of JMS message) will be
> placed

Yes. But the url must be exactly as is. See also this FAQ
http://camel.apache.org/how-do-i-let-jetty-match-wildcards.html


> on incomingOrders queue. Is that correct? If yes do i need to put any camel
> specific servlet under web.xml of my webserver?
>

No, you just need camel-jetty on the classpath.
If you want you can use camel-servlet to use a servlet, and then you
need to put servlet stuff in your web.xml.
http://camel.apache.org/servlet

See this example
http://camel.apache.org/servlet-tomcat-example.html


> Another point is incoming request can contain both type of paramters i.e
> form paramter and file upload request (in the form of multipart request)
> then how come
> below configuration checking "?xml" in file parameter not in form parameter?
>
> <route id="NormalizeMessageData">
>         <from uri="jms:incomingOrders" />
>                 <convertBodyTo type="java.lang.String" />
>                         <choice>
>                                 <when>
>                                         <simple>${body} contains '?xml'</simple>
>                                                 <unmarshal>
>                                                         <jaxb contextPath="org.fusesource.camel" />
>                                                 </unmarshal>
>                                                 <to uri="jms:orders" />
>                          </when>
>                          <otherwise>
>                          some configuration
>                          </otherwise>
>                         </choice>
> </route>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Will-web-request-be-intercepted-by-CAMEL-with-this-configuration-tp5750063.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Will web request be intercepted by CAMEL with this configuration?

Posted by scottmiles <mo...@gmail.com>.
i mean does camel convert all the request parameters and attributes whether
it form parameter or file upload request parameter in to string first and
then check "?XML" in each of the parameter/attribute?



--
View this message in context: http://camel.465427.n5.nabble.com/Will-web-request-be-intercepted-by-CAMEL-with-this-configuration-tp5750063p5750115.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Will web request be intercepted by CAMEL with this configuration?

Posted by scottmiles <mo...@gmail.com>.
Thanks Claus. Any idea about below query

Another point is incoming request can contain both type of paramters i.e
form paramter and file upload request (in the form of multipart request)
then how come 
below configuration checking "?xml" in file parameter not in form parameter? 

<route id="NormalizeMessageData">
        <from uri="jms:incomingOrders" />
                <convertBodyTo type="java.lang.String" />
                        <choice>
                                <when>
                                        <simple>${body} contains
'?xml'</simple>
                                                <unmarshal>
                                                        <jaxb
contextPath="org.fusesource.camel" />
                                                </unmarshal>
                                                <to uri="jms:orders" />
                         </when>
                         <otherwise>
                         some configuration 
                         </otherwise>
                        </choice>    
</route>



--
View this message in context: http://camel.465427.n5.nabble.com/Will-web-request-be-intercepted-by-CAMEL-with-this-configuration-tp5750063p5750113.html
Sent from the Camel - Users mailing list archive at Nabble.com.