camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <brad.john...@mediadriver.com>
Subject Re: Help with JSON to POJO using XML Routes
Date Tue, 27 Sep 2016 21:38:21 GMT
By the way, which version of Camel are you using?  And maybe I'm not quite
understanding what you're trying to do but it sound like you want to call *to
*an http endpoint and aren't waiting to receive from the endpoint.

On Tue, Sep 27, 2016 at 4:04 PM, jeffz <jzeha@hotmail.com> wrote:

> I'm using Camel - through ServiceMix - to retrieve data from a web service,
> read the response and pass the data to another application.  This code was
> inherited, so much of the framework already exists.  it used to read from a
> database, but now needs to get its input from the web service response.
> Problem is, I can't figure out how to read the data into the bean and all
> my
> log statements within the java code get ignored. This makes debugging
> difficult.  I was hoping someone with more experience could shed some light
> on my situation.  For those paying attention, I did post on the ServiceMix
> board, but that was a different question in the same route.
>
> Questions:
>         1) How do I reference a set of java classes to unmarshal the
> message
> using the Jackson API?
>         2) How do I enable logging within the java bean?
>         3)These messages are quite large.  How do I stream data into the
> Exchange/POJO?
>
>
> Here are my routes:
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint
>     xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>     xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="
>       http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>
>
>         <cm:property-placeholder id=placeholder"
> persistent-id="com.example">
>         <cm:default-properties>
>                 <cm:property name="url" value="example.com"/>
>         </cm:default-properties>
>     </cm:property-placeholder>
>
>
>         <bean id="espSendMailService" class="com.service.SendMailService">
>                 <property name="list" value="${list.id}" />
>         </bean>
>         <bean id="jack"
> class="org.apache.camel.component.jackson.JacksonDataFormat">
>         </bean>
>
>         <bean id="tst" class="com.example.RetailStoreReturnPOJO">
>         </bean>
>         <bean id="StoreLoadBean" class="com.example.StoreLoad">
>                 <property name="dataSource" ref="DB" />
>                 <property name="silverpopTableIds" value="${ids}" />
>         </bean>
>
>     <camelContext id="camelroutes"
> xmlns="http://camel.apache.org/schema/blueprint" trace="true">
>
>
>                 <route>
>                         <from uri="activemq:test"/>
>                         <from uri="http4://{{url}}"/>
>                         <to uri="activemq:retailout"/>
>                 </route>
>
>                 <route>
>                         <from uri="activemq:retailout"/>
>                         <doTry>
>                         <unmarshal ref="tst"/>
>                         <to uri="log:output"/>
>                         <to uri="bean:StoreLoadBean?method=
> loadRetailStoreDataFromMap"/>
>                         <log message="complete"/>
>                         <doCatch>
>                                 <exception>java.lang.Exception</exception>
>                                 <to uri="log:activemq.
> retailouterror?level=WARN"/>
>                         </doCatch>
>                         </doTry>
>                 </route>
>     </camelContext>
>
> </blueprint>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Help-with-JSON-to-POJO-using-XML-Routes-tp5788130.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message