[
https://issues.apache.org/activemq/browse/CAMEL-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45274#action_45274
]
Claus Ibsen commented on CAMEL-797:
-----------------------------------
After messing with letting camel handle the entry point with cxf I am not happy
with it. It will require quite a context change for end-users to let it handle
it properly, and I feel as a developer I lose a little control.
Also I had to use cxf:endpoint to configure it using spring xml and not jaxws
(I got a ClassCastException). Will report it later.
And frankly to handle any exceptions during the routing requires to use a more
powerful DSL style and I frankly don't think we are there yet int the tutorial.
(Maybe for part 7+).
{code:java}
private static OutputReportIncident OK = new OutputReportIncident();
private static OutputReportIncident VALIDATION = new OutputReportIncident();
private static OutputReportIncident ERROR = new OutputReportIncident();
public void configure() throws Exception {
OK.setCode("0");
VALIDATION.setCode("1");
ERROR.setCode("9");
// first part from the webservice -> file backup
from("cxf:bean:reportIncident")
.tryBlock()
.convertBodyTo(InputReportIncident.class)
.bean(ValidateIncidentService.class)
.setHeader(FileComponent.HEADER_FILE_NAME,
bean(FilenameGenerator.class, "generateFilename"))
.to("velocity:MailBody.vm")
.transform(constant(OK))
.handle(IncidentValidationException.class)
.transform(constant(VALIDATION))
.handle(Exception.class)
.transform(constant(ERROR))
.end();
}
{code}
So part 5 will be a gentle introduction to let Spring create the camel context
and we will take it from there in baby steps.
> Add a part 4 to the tutorial (camel-example-reportincident) to show how to
> turn on the code to route messages using DSL language and/or spring xml
> configuration file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-797
> URL: https://issues.apache.org/activemq/browse/CAMEL-797
> Project: Apache Camel
> Issue Type: Improvement
> Components: documentation, examples
> Affects Versions: 1.4.0
> Reporter: Charles Moulliard
> Assignee: Claus Ibsen
> Fix For: 1.5.0
>
> Attachments: part-four.zip
>
>
> Hi,
> First of all, I would like to thanks Claus for the quality of its tutorial.
> This is a great job for the camel community to have now a second tutorial
> showing the magic of Camel.
> What I would like to propose is to add a fourth part to this tutorial to show
> :
> - How to turn on the code to DSL language and/or spring xml configuration
> file ?
> - How the architecture can be adapted to use Camel as the entry point of the
> web service instead of the CxFServlet ?
> Task to do
> 1) Adapt the architecture to allow Camel to become the entry point of the web
> services
> 2) Transpose the code to routes the messages between the endpoints using DSL
> language through a java class
> 3) Idem bu using a spring configuration file
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.