ProducerTemplate ... why no asyncSendBodyAndHeader(s)?

2014-03-21 Thread Mike Oxford
asyncRequestBodyAndHeaders exists ...
sendBodyAndHeaders exists...

Why no asyncSendBodyAndHeaders?

Thanks!


SendBodyAndProperties

2014-06-13 Thread Mike Oxford
There is a "SendBodyAndProperty" (singular.)
This is a "SendBodyAndHeader" (plural)

Why is there no plural version of the properties?


Jackson question... why does this fail?

2013-06-19 Thread Mike Oxford



...

   // mina component
   // unmarshal it
  // marshal it


I can put a bean:myBean in between and see that, yes, it is being
unmarshalled correctly.  Even more complex JSON will unmarshall correctly,
and I can traverse the returned Map.

{"a":5} // input
[B@73207f36  // output

Why does the  call return crap (an object ref of some kind?) even
for simple calls?

Thanks,

-mox


Jackson/JSON unmarshall

2013-06-24 Thread Mike Oxford
Hi all.

Given that you can use Jackson to unmarshall to "unmarshalTypeName="
(which works for a 1:1 mapping) how does one go about "dynamically
unmarshalling" a JSON document to "N-possible classes?"
eg, full protocol work, based on a piece of the JSON itself.

I can build something using the java DSL, or letting Jackson unmarshal
to a Map and then building POJOs by hand, but I'm wondering if there's
a better way, ideally, using the Spring XML syntax.

Something like ..







This way I can use a bean to determine which class to map the JSON to,
instead of hardcoding to a single class.

Thanks,

-mox


Re: New Instance of CamelContext from Spring

2013-07-20 Thread Mike Oxford
In Spring, you can set the scope='prototype' on a bean to stop it from
being, effectively, a singleton.
The same may work for your context, but I am not sure.

G'luck.

-mox

On Sat, Jul 20, 2013 at 2:01 PM, SyedBhai wrote:

> Hi Guys,
>   I have configured camel context in a spring file.
>   Sample configuration is
> http://camel.apache.org/schema/spring";>
>  
>   
>uri="http://localhost:8080/AirpostDSP1/webresources/getAd/airportAd"/>
>  
> 
>
>   But I have noticed that if I invoke getBean("c1") method of spring
> application context, I am getting the same object for every call.  I mean
> the hashcode is same.
>
>   I actually want to have a new instance of camel context everytime I
> invoke
> the getBean("c1") method.
>
>   Is it possible?  If yes, how?
>
> Thanks,
> Syed.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/New-Instance-of-CamelContext-from-Spring-tp5735942.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Dynamic xsl with custom uri resolver

2013-08-02 Thread Mike Oxford
The CSS which is loaded is defined in your HTML.  If you're going to use a
parameter to fetch the HTML, you're going to have to dynamically rewrite
that HTML to point to the correct CSS.

Whether you use a handler to rewrite where to get the CSS file, or whether
it shoves all the CSS into the HTML and just delivers that ... either way
you're going to end up modifying the document delivered.

Or you'll have to create a lot of duplicates and de-normalize everything
... which works just fine until you make a change and have to update 50
documents.  =)

Or you write some javascript which looks at the document.URL, figures out
what CSS it needs, and then dynamically loads those files after the fact.
 Could be doable if you kept it sync so the JS blocks page render until
it's done with the CSS loading.

Pick yer poison...

-mox




On Thu, Aug 1, 2013 at 8:23 PM, ericsodt  wrote:

> Anyone have any ideas?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Dynamic-xsl-with-custom-uri-resolver-tp5736668p5736670.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Conceptual understanding of altering routes runtime

2013-09-18 Thread Mike Oxford
I believe you can "synthesize" with a dynamic-router.

Get first chunk, route to processor-route.  When that route completes, it
will head back to dynamic-router with the same Exchange.  If that Exchange
has a property which says "this SQL connection" and a property which says
"this starting number" (or, if you have the handle to the SQL connection,
using a cursor) it may work for you.

G'luck...

-mox



On Thu, Sep 5, 2013 at 1:26 AM, Claus Ibsen  wrote:

> Hi
>
> Also you dont have to use Camel routes.
> Sometimes just use Camel as a client API and use ProducerTemplate /
> ConsumerTemplate to use the Camel components can be fine.
>
>
>
> On Wed, Sep 4, 2013 at 6:53 PM, lassesvestergaard
>  wrote:
> > Hi all.
> >
> > This is a spinoff of a previous post:
> > http://camel.465427.n5.nabble.com/Change-timer-runtime-td5738484.html
> >
> > I decided to start a new thread, because I think this question is of a
> more
> > general character.
> >
> > First of all, I ran into a problem regarding how to update a camel route
> > runtime. My concrete problem is that I can't figure out how to update a
> sql
> > query runtime. If I, for instance, want to have a query that fetches the
> > first 3000 records of a table, on the first cycle of the camel route
> (let's
> > say I use a timer to "fire" the route). In the next cycle, I want to
> fetch
> > from record 3001 to 6000. I simply can't get my head around this problem,
> > which is extremely simple in regular java. My conclusion from this is,
> that
> > I have some fundamental misconceptions of what Apache camel is, and
> therefor
> > I want to use this thread to discuss runtime altering of routes.
> >
> > For starters: As I understand, an Exchange is a entity that only exists
> > within a single cycle of a route. This means that I can't use the
> Exchange
> > object to save variables that I can use in the next cycle of the route.
> This
> > further means that I can't use Exchange to alter configurations of a
> > component - ex. I can't use it for giving the timer component a different
> > period and I can't use it for altering variables in a sql query.
> >
> > Besides this, it seems that you can only write your route once, and the
> > first time it's run, all component configurations are set - they cannot
> be
> > altered from within the route it self. In my specific case, I have tried
> to
> > put java variables into my sql query (having them assigned as class
> scoped
> > attributes). In my route I have a Processor (see referenced thread at the
> > top), and in that I have altered the java attributes. This seems to work
> > fine, but the sql query doesn't get updated with the new value of my java
> > variable.
> >
> > Furthermore, I haven't been able to find any good examples, that show
> how to
> > alter the route configurations runtime (actually the configurations of
> each
> > component in a route).
> >
> > Since I can't Google the problem away, I conclude that I have issues on
> the
> > conceptual understanding of Camel. So, could someone please clarify how
> to
> > understand runtime alterings of routes, and it would be even better if
> you
> > have some concrete coding examples.
> >
> > I have chosen to use the java DSL approach instead of Spring.
> >
> > Best regards
> >
> > Lasse Vestergaard
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Conceptual-understanding-of-altering-routes-runtime-tp5738697.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>