camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Commented] (CAMEL-3104) ExchangeBuilder to create messages using fluent builder style
Date Wed, 29 Aug 2012 06:58:07 GMT


Claus Ibsen commented on CAMEL-3104:

I think the class should be moved to the builder package, and be declared as final (not ment
for inheritance for end users).

And it should have javadoc, as its an end user API.

Also the headers should only be set if there is any headers (eg not empty).
And I guess we could add API for attachments as well? Or do we want the builder API to be
kept simple?

And what if you want to set the message as a fault message? I know its seldom used?
As well setting the messageId on the Message? I guess that is more often a component specific
issue that they can do that.
I guess we should not add these as ppl can set them manually afterwards directly using the
existing Exchange API.

> ExchangeBuilder to create messages using fluent builder style
> -------------------------------------------------------------
>                 Key: CAMEL-3104
>                 URL:
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 3.0.0
>         Attachments: ExchangeBuilder.diff
> So you from the Java API using a fluent builder style, can create an Exchange to send,
for example with the ProducerTemplate.
> Currently you can use a inlined Processor to do that but its a bit ugly and verbose.
> {code}
> Exchange exchange = ExchangeBuilder("activemq:queue:foo").withBody("Hello World").andHeader("JMSReplyTo",
"bar").andHeader("foo", 123).create();
> template.send(exchange);
> {code}
> The trick is the Exchange has to be created by the producer and hence we need to know
the endpoint uri where to send it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message