Hi Guillaume,
sure
Here there's the xbean for http-su:
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:foo="http://servicemix.org/cheese">
<http:endpoint
defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
service="foo:mySplitterTestSplitter"
endpoint="myWebServiceTestSplitter"
role="consumer"
locationURI="http://0.0.0.0:8192/tsplitter/"
soap="true">
</http:endpoint>
</beans>
here there's the xbean for eip-su:
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:eip="http://servicemix.apache.org/eip/1.0"
xmlns:foo="http://servicemix.org/cheese">
<eip:xpath-splitter
service="foo:mySplitterTestSplitter" endpoint="mySplitterTestSplitter"
xpath="/ACTIONS/ACTION">
<eip:target>
<eip:exchange-target
service="foo:myRouterTestRouter"/>
</eip:target>
</eip:xpath-splitter>
</beans>
Here there's the xbean for drools-su:
<?xml version="1.0"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:drools="http://servicemix.apache.org/drools/1.0"
xmlns:foo="http://servicemix.org/cheese>
<drools:endpoint service="foo:myRouterTestRouter"
endpoint="myRouterTestRouter"
ruleBaseResource="classpath:myRouterTestRouter.drl"/>
</beans>
The the lw-su file ( servicemix.xml )
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:foo="http://servicemix.org/cheese"
>
<classpath>
<location>.</location>
</classpath>
<sm:serviceunit id="jbi">
<sm:activationSpecs>
<!-- ####################### myScreenOutputTestSplitter
######################## -->
<sm:activationSpec componentName="myScreenOutputTestSplitter"
service="foo:myScreenOutputTestSplitter">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.apache.servicemix.components.util.StreamWriterComponent">
</bean>
</sm:component>
</sm:activationSpec>
<!-- ####################### myMailServerTestSplitter
######################## -->
<sm:activationSpec componentName="myMailServerTestSplitter"
service="foo:myMailServerTestSplitter">
<sm:component>
<bean class="org.apache.servicemix.components.email.MimeMailSender">
<property name="marshaler">
<bean
class="org.apache.servicemix.components.email.MimeMailMarshaler">
<property name="from">
<bean
class="org.apache.servicemix.expression.ConstantExpression">
<constructor-arg value="ServiceMix" />
</bean>
</property>
<property name="to">
<bean
class="org.apache.servicemix.expression.ConstantExpression">
<constructor-arg value="[EMAIL PROTECTED]" />
</bean>
</property>
<property name="subject">
<bean
class="org.apache.servicemix.expression.ConstantExpression">
<constructor-arg value="wwwww" />
</bean>
</property>
<property name="text">
<bean
class="org.apache.servicemix.expression.ConstantExpression">
<constructor-arg value="sdsdsfdfd" />
</bean>
</property>
</bean>
</property>
<property name="sender">
<bean
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="mail.eng.it" />
<property name="port" value="25" />
</bean>
</property>
</bean>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:serviceunit>
</beans>
The drl file packaged in drool-su is:
package org.apache.servicemix.drools
import org.apache.servicemix.drools.model.Exchange;
global org.apache.servicemix.drools.model.JbiHelper jbi;
rule "RuleNum1"
when
me : Exchange( status == Exchange.ACTIVE, in : in != null )
eval( in.xpath("//ACTION/@name = 'START_ACTION'") )
then
jbi.getLogger().debug("****************** me"+ me);
jbi.getLogger().debug("****************** in"+ in);
jbi.getLogger().debug("Evaluated as true RuleNum2");
jbi.route("service:http://servicemix.org/cheese/myMailServerTestSplitter");
end
rule "RuleNum2"
when
me : Exchange( status == Exchange.ACTIVE, in : in != null )
eval( in.xpath("//ACTION/@name != 'START_ACTION'") )
then
jbi.getLogger().debug("****************** me"+ me);
jbi.getLogger().debug("****************** in"+ in);
jbi.getLogger().debug("Evaluated as true RuleNum3");
jbi.route("service:http://servicemix.org/cheese/myScreenOutputTestSplitter");
end
Guillaume Nodet ha scritto:
Can you just paste your xbean.xml config files ?
I really don't see any reason why it would not work,
but maybe a library has changed which gives this side effect ...
On 3/12/07, Andrea Zoppello <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to port a service assembly that work correctly in smx 3.0 to
smx 3.1.
The strutcure of my service assembly is
HTTP(BC) --> EIP XPATH Splitter --> Drools Router -> Stream or Mail
The XPath Splitter split on the xpath expression (/ACTIONS/ACTION ) then
each /ACTION element will be processed and i write a simple drl file
that
evaluate the "name" attribute and go to the mail or to the screen.
The strange thing is that if i've a input like this:
<ACTIONS>
<ACTION name="START_ACTION"
class="it.eng.spago.dispatching.action.util.PublishAction"
scope="REQUEST">
<CONFIG/>
</ACTION>
</ACTIONS>
with only one ACTION inside ACTIONS element it works.
If i've a input like:
<ACTIONS>
<ACTION name="START_ACTION"
class="it.eng.spago.dispatching.action.util.PublishAction"
scope="REQUEST">
<CONFIG/>
</ACTION>
<ACTION name="TWO"
class="it.eng.spago.dispatching.action.util.PublishAction"
scope="REQUEST">
<CONFIG/>
</ACTION>
</ACTIONS>
it does not work anymore.
I've write two separated service assembly to test the EIP Xpath splitter
and Drools 3.1
router separately, and each one seems to get the right behaviour.
The problem is when i try to use the two together.
Does anyone have some suggestion?
If it's possible i can attach my sa zip file, but i do that the post
will be rejected.
thanks in advance