You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Andrea Zoppello (JIRA)" <ji...@apache.org> on 2008/02/26 10:49:17 UTC

[jira] Created: (SM-1248) ServiceMix Drools Enhancements

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.


[jira] Commented: (SM-1248) ServiceMix Drools Enhancements

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41426#action_41426 ] 

Guillaume Nodet commented on SM-1248:
-------------------------------------

It looks perfect to me.

> 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.


[jira] Reopened: (SM-1248) ServiceMix Drools Enhancements

Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Zoppello reopened SM-1248:
---------------------------------


The provided JBI Helper cause problem when you've sa that

1) Has chained drools endpoint ( in drl file where routing with jbi.route to another drools endpoint)

2) You're testing this with concurrent messages ( high load )

The problems seems to be that the provided route method in jbi helper, use sensSync instead of send.

I provide a new code for route method, that i've tested and solve the problem:

public void routeTo(String content, String uri) throws MessagingException {
    	
    	
    	MessageExchange me = this.exchange.getInternalExchange();
    	
    	if ((me instanceof InOnly) || (me instanceof RobustInOnly)) {
    		 NormalizedMessage in = null;
    	        if (content == null){
    	        	in = me.getMessage("in");
    	        } else{
    	        	in = me.createMessage();
    	            in.setContent(new StringSource(content));
    	        }
    	        MessageExchange newMe = getChannel().createExchangeFactory().createExchange(me.getPattern());
    	        URIResolver.configureExchange(newMe, getContext(), uri);
    	        MessageUtil.transferToIn(in, newMe);
    	      
    	        // If i am in route method could send back the done 
    	        me.setStatus(ExchangeStatus.DONE);
    	        getChannel().send(me);
    	        
    	        // And send forward the new me
    	        getChannel().send(newMe);
    	        update();
    	      
			
		}else{
			throw new IllegalStateException(" route method should be used for InOnly or Robus In Only Exchange for InOutExchange use answer");
		}
       
    }



> 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
>            Assignee: Guillaume Nodet
>             Fix For: 3.2.2, 3.3
>
>         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.


[jira] Updated: (SM-1248) ServiceMix Drools Enhancements

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated SM-1248:
-----------------------------

    Fix Version/s:     (was: 3.2.2)

> 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
>            Assignee: Guillaume Nodet
>             Fix For: 3.3
>
>         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.


[jira] Commented: (SM-1248) ServiceMix Drools Enhancements

Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41429#action_41429 ] 

Andrea Zoppello commented on SM-1248:
-------------------------------------

Ok looks good for me.

remove the correlation ID and sender stuff

> 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.


[jira] Resolved: (SM-1248) ServiceMix Drools Enhancements

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved SM-1248.
---------------------------------

         Assignee: Guillaume Nodet
    Fix Version/s: 3.2.2
                   3.3
       Resolution: Fixed

Sending        drools/DroolsEndpoint.java
Sending        drools/model/JbiHelper.java
Transmitting file data ..
Committed revision 631969.

Sending        servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsEndpoint.java
Sending        servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java
Transmitting file data ..
Committed revision 631970.

> 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
>            Assignee: Guillaume Nodet
>             Fix For: 3.2.2, 3.3
>
>         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.


[jira] Updated: (SM-1248) ServiceMix Drools Enhancements

Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Zoppello updated SM-1248:
--------------------------------

    Attachment:     (was: DroolsEndpoint.java.patch)

> 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.


[jira] Resolved: (SM-1248) ServiceMix Drools Enhancements

Posted by "Gert Vanthienen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gert Vanthienen resolved SM-1248.
---------------------------------

    Resolution: Fixed

Instead of doing the proposed change, we should revamp servicemix-drools to support full asynchronous messaging support (cfr. SM-1502)

> 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
>            Assignee: Guillaume Nodet
>             Fix For: 3.3
>
>         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.


[jira] Commented: (SM-1248) ServiceMix Drools Enhancements

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41428#action_41428 ] 

Guillaume Nodet commented on SM-1248:
-------------------------------------

BTW, if you look at https://issues.apache.org/activemq/browse/SM-1005, it seems the properties around the correlationId / senderEndpoint are not needed anymore, so I'll remove them when applying the patch.

> 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.


[jira] Commented: (SM-1248) ServiceMix Drools Enhancements

Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41420#action_41420 ] 

Andrea Zoppello commented on SM-1248:
-------------------------------------

Hi,

1) What you suggest to do when exchange Is InOut??

2) defaultTargetService in my point of view must be used, where you want specify service in terms of
qname, otherwise you'll use the default targetURI

3) Agree on the separator observation.

4) I simply need a way that user express the concept of an "application fault", but as i explained this from a jbi point of view is a "correct message" i just implemented a new method in jbi helper so the user could use jbi helper to logically express this three situation

a) nomal routing with jbi route
b) fail with a jbi fault ( jbi fault )
c) fail logically "faultToDefaultTarget"

5) regards sender and correlation id, i've some doubt on this, i simply take our previous patches ( that was rererred to smx 3.1.x ), if this is not needed anymore, we could avoid it 

I agree with probably the "faultToDefaultTarget" could be avoided but this allow the rules writer to distiguish
the case of both jbi and logical fault.

5) I've used the smx 3.2.1 source and used the create patch command.

> 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.


[jira] Updated: (SM-1248) ServiceMix Drools Enhancements

Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Zoppello updated SM-1248:
--------------------------------

    Attachment:     (was: JbiHelper.java.patch)

> 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.


[jira] Updated: (SM-1248) ServiceMix Drools Enhancements

Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Zoppello updated SM-1248:
--------------------------------

    Attachment: JbiHelper.java.patch
                DroolsEndpoint.java.patch

Hi Guillaume,

About fault, i totally agree with you, the only reason why i provided a faultToDefaultTarget services, is that some user refers to "logical errors" with the term fault also if this is not really a jbi fault, and they want to manage the fault by hand
within the flow.

The fault in that case is a message with a particular content, that is for example handled by a router, in most of my use case my users do the thing as i described, they use faultTodefaultTargetService with a particular message content and they manage with a router.

BTW now i'm going to inform them to use the routeToDefault(content) method.

I think we're just sayng the same thing, it's just terminology.

The new patch apply all suggestion you've made.

Take a look and let me know

Regards

> 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, DroolsEndpoint.java.patch, JbiHelper.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.


[jira] Commented: (SM-1248) ServiceMix Drools Enhancements

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (SM-1248) ServiceMix Drools Enhancements

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41416#action_41416 ] 

Guillaume Nodet commented on SM-1248:
-------------------------------------

A few comments:
  * I need to have a closer look, but I think the default route mechanism won't work if the exchange is an InOut.
  * if defaultTargetService is non null, but has no namespace, an NPE will be thrown in getDefaultRoutUri() 
  * the separator should be extracted using the following, to accomodate more URIs
       String sep = (nsURI.indexof("/") > 0) ? "/" : ":";
  * I don't understand how your fault mechanism work.  sending back a fault should not lead to creating a new message.  It seems you are acting as a proxy, the same way the route(String uri) method does, but you specify the content instead of the destination (which is always the default route), right ?  I just find the name misleading as it does not send a fault at all
   * for the correlationId / sendderEndpoint, are you sure this is needed ? It should be set automatically when sending the message, unless drools is multithreaded and the sending does not happen in the same thread as the receiving (which i doubt, given that drools is blocking when we fire the rules).
  
I can't apply the patch to the 3.2 branch nor the trunk ?
Which version did you use to generate them ?

> 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.


[jira] Updated: (SM-1248) ServiceMix Drools Enhancements

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated SM-1248:
--------------------------------

    Fix Version/s: servicemix-drools-2008.01

> 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
>            Assignee: Guillaume Nodet
>             Fix For: 3.3, servicemix-drools-2008.01
>
>         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.