camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <>
Subject Re: @Produce vs @ProducerTemplate
Date Mon, 08 Aug 2016 14:22:26 GMT
Ugh, early Monday...That should be @EndpointInject of ProducerTemplate and
not @ProducerTemplate.

On Mon, Aug 8, 2016 at 9:02 AM, Brad Johnson <>

> I use producer template quite a bit and it works well but it obviously is
> a bit more coupled to the Camel API than using the @Produce with an
> interface.
> The problem is I can't tell exactly when @Produce is going to work as I
> expect it to.  Currently I have two routes, for example, one that makes a
> call to a direct route to do a look up and return a field during
> processing.  It works fine.
> A second route that I have is similar but it sends a String fileName to a
> an error route to send and email via a velocity template.  If I use the
> ProducerTemplate that works fine.  If I use the @Produce what I end up with
> is the body rendered showing the BeanInvocation proxy itself with the
> actual body to be rendered contained with in it.
> I ran into this before in an different situation and ended up removing the
> @Produce although I was actually able to cause it to work correctly by an
> indirect bean call on it which seems to have cause the proxy to divulge its
> contents.
> In this particular case I'm invoking the interface which sends it to a
> second route that sets other information like to/from/subject and then uses
> a recipientList to invoke the velocity template I've specified for that
> particular error message.
> Brad

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