[
https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41422#action_41422
]
Guillaume Nodet commented on SM-1248:
-------------------------------------
1) Well, I retract. The patch should already handle that case by calling
helper.route(uri). This should also work on InOut exchanges
2) I agree, but new QName("hello") is a valid QName, so handling such case
(where defaultTargetService.getNamespace() == null) is trivial and avoid a
possible NPE, that's all. But it seems the URIResolver won't really support
these anyway, so maybe just keep it as it is.
4) I'm not sure what your exactly mean. An application fault should be
modeled as a "fault" message in JBI. Transient errors, like connections
problems are modelled by errors. You can model your flow to send a message
instead of a fault (which may be needed in some cases), but this should be
considered as a message, as the target will have no way to know this is a
fault. Think about the WSDL description of your service: faults are described
using xml elements, but are still faults. The other way is to create a message
and put a boolean to indicate a fault: this is equivalent to what we did in C
when there were no exceptions, i.e. a flag indicates the success / failure.
Anyway, the code of the method is almost 100% identifical to the route()
method, but it changes the content and use the default target instead.
Why not having the following methods:
{code}
void route(String uri) {
routeTo(null, uri);
}
void routeTo(String content, String uri) {
// modified version to accomodate the two parameters
...
}
void routeToDefault(String content) {
routeTo(content, endpoint.getDefaultRouteURI());
}
{code}
What do you think ?
> ServiceMix Drools Enhancements
> ------------------------------
>
> Key: SM-1248
> URL: https://issues.apache.org/activemq/browse/SM-1248
> Project: ServiceMix
> Issue Type: Improvement
> Components: servicemix-drools
> Affects Versions: 3.2.1
> Reporter: Andrea Zoppello
> Attachments: DroolsEndpoint.java.patch, JbiHelper.java.patch
>
>
> To be complete the servicemix 3.2.1 drools components, require some
> enhancements:
> 1) There's the need to support a default destination, where exchange will be
> routed if none rules in the drools file is verified.
> To support this, we need to provide a way to specify default destinations.
> there will be a defaultTargetService ( QName ) attribute and a
> defaultTargetURI attribute in drools endpoint class. ( defaultTargetURI will
> have the precedence on defaultTargetServiceAttribute)
> 2) We must add the possibility to configure not only global "objects" for
> memory but also a list of "asserted objects" to be asserted in memory ( so
> it's possible to use that objects in LHS part of rules )
> 3) The actual code of jbi helper does not care about sender and correlation
> id.
> 4) We need a method in jbi helper object to support the concept of fault
> withn the flow, ( to default destination ) without generate a jbi fault. a
> fault in flow from jbi point of view is a "correct" normalized message.
> The attached patches solve all the above in a very generic way.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.