Just use the send/request method that takes a processor, and then use
an inlined processor to set the headers/properties/body on the
exchange in message.

There is also an ExchangeBuilder AFAIR that you may use as well. Then
you can use that to create an exchange, to send with the produce
template.

On Fri, Jan 3, 2014 at 12:41 PM, Stephan Burkard <sburk...@gmail.com> wrote:
> Hi Henryk
>
>> Are you sure? :) Exchange properties are propagated as well as
>> headers. Can you show me an example, where the properties are not
>> propagated down the route?
>
> Wow, I just realized that there are producer methods to send a body and a
> property. I never noticed them before because I always used the ones for
> body and header(s).
>
> But however, I need to send expected headers into most of my tests, so I
> would need to have a method that takes body, header-map and a property or
> even a property-map. At least in my current Camel version (2.9.x) I didn't
> found a way to do this. Am I wrong? Have you another pleasant surprise for
> me? :)
>
> Thanks a lot!
> Stephan
>
>
>
> On Tue, Dec 31, 2013 at 11:06 AM, Henryk Konsek <hekon...@gmail.com> wrote:
>
>> > @Henryk: Yes, that works fine for message headers, I use it a lot to pass
>> > expected message headers. But it is not possible for Exchange properties.
>>
>> Are you sure? :) Exchange properties are propagated as well as
>> headers. Can you show me an example, where the properties are not
>> propagated down the route?
>>
>> > @Willem: Yes, that's true. It feels a bit "cumbersome", but it works.
>>
>> Yeah, the whole point of using mocking library is to reduce the
>> boilerplate, so I won't implement interfaces as well. Also not always
>> you would like to introduce interface for the bean and tests design
>> shouldn't force you to do so. There is also a chance that you might
>> work with 3rd party beans (developed by the other team for example)
>> which you can't refactor. You definitely need a way to live with the
>> mocks in your routes :) .
>>
>> > Based on your answers, I guess there is no fundamental Camel concept I am
>> > missing, but simply the Camel best practices that need to mature in my
>> > Camel routes and tests :-)
>>
>> Yes. There is no hidden Camel feature that could help you here. :)
>>
>> --
>> Henryk Konsek
>> http://henryk-konsek.blogspot.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
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to