You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by scottmiles <mo...@gmail.com> on 2014/04/07 19:20:16 UTC

How to call processor thru configuration file ?

My application needs to work as middleware where it has got orders(in form of
xml) from various customers which contains the 
supplier id where custmers can send the xml to one of these components 

    1)JMS queue 
    2)File system 
    3)HTTP 
    4)Web service request(rest/soap) 

Once it get the order, it needs to send order request to different suppliers
in the form of xml.Somehow i spotted 
http://java.dzone.com/articles/open-source-integration-apache and looks like
its provides the perfect solution. 
My question is :- 

 At the link in Figure 3, How can I introduce my OrderService in between
output of marshalling(which is POJO here)  and order queue 
 output of marshalling -----------> OrderService(instead of order
queue)-------------->orderQueue 
 
  Probably i
 
 <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>
  <unmarshal>
    <bindy packages="org.fusesource.camel" type="Csv" />
  </unmarshal>
<to uri="jms:orders" />
</otherwise>
</choice>    
</route>
 
How will i route the output to  process() method my processor
class(MyOrderProcessor) in above configuration?
 
Once call goes to process() method MyOrderProcessor, i want to put output of
process() method on JMS Queue?



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-call-processor-thru-configuration-file-tp5749904.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to call processor thru configuration file ?

Posted by Charlie Mordant <cm...@gmail.com>.
Hi,

You can use inOut instead of to in order to have the output of your
processor in the body of the exchange:
http://camel.apache.org/request-reply.html.

Hope it'll help.

Regards


2014-04-07 19:20 GMT+02:00 scottmiles <mo...@gmail.com>:

> My application needs to work as middleware where it has got orders(in form
> of
> xml) from various customers which contains the
> supplier id where custmers can send the xml to one of these components
>
>     1)JMS queue
>     2)File system
>     3)HTTP
>     4)Web service request(rest/soap)
>
> Once it get the order, it needs to send order request to different
> suppliers
> in the form of xml.Somehow i spotted
> http://java.dzone.com/articles/open-source-integration-apache and looks
> like
> its provides the perfect solution.
> My question is :-
>
>  At the link in Figure 3, How can I introduce my OrderService in between
> output of marshalling(which is POJO here)  and order queue
>  output of marshalling -----------> OrderService(instead of order
> queue)-------------->orderQueue
>
>   Probably i
>
>  <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>
>   <unmarshal>
>     <bindy packages="org.fusesource.camel" type="Csv" />
>   </unmarshal>
> <to uri="jms:orders" />
> </otherwise>
> </choice>
> </route>
>
> How will i route the output to  process() method my processor
> class(MyOrderProcessor) in above configuration?
>
> Once call goes to process() method MyOrderProcessor, i want to put output
> of
> process() method on JMS Queue?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-call-processor-thru-configuration-file-tp5749904.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>