EIP Router-Dispatcher

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

EIP Router-Dispatcher

jihad22
Hi again :)

I've created a Router pattern and link it with Dispatcher, can u tell me is there an error in the codes below:

su-EIP-RouterService
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
        xmlns:eip="http://petals.ow2.org/components/eip/version-2"
        xmlns:generatedNs="http://localhost:8080/axis/"
        xmlns:jbi="http://java.sun.com/xml/ns/jbi"
        xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       
        <jbi:services binding-component="false">
                <jbi:provides
                        interface-name="generatedNs:router"
                        service-name="generatedNs:routerService"
                        endpoint-name="routerServiceEndpoint">
       
                       
                        <petalsCDK:timeout>30000</petalsCDK:timeout>
                        <petalsCDK:validate-wsdl>true</petalsCDK:validate-wsdl>
                        <petalsCDK:forward-security-subject>false</petalsCDK:forward-security-subject>
                        <petalsCDK:forward-message-properties>false</petalsCDK:forward-message-properties>
                        <petalsCDK:forward-attachments>false</petalsCDK:forward-attachments>
                        <petalsCDK:wsdl xsi:nil="true" />
               
                       
                        <eip:eip>router</eip:eip>
                    <eip:test-operation>//*[local-name()="add"]</eip:test-operation>
                        <eip:fault-robust>false</eip:fault-robust>
                        <eip:exception-robust>false</eip:exception-robust>
                        <eip:attachment-mode>false</eip:attachment-mode>
                </jbi:provides> 
               
               
               
                <jbi:consumes
                        interface-name="iConsumeNsPrefix:dispatcher"
                        service-name="iConsumeNsPrefix:dispatcherService"
                        endpoint-name="dispatcherServiceEndpoint"
                        xmlns:iConsumeNsPrefix="http://localhost:8080/axis/Somme.jws">
                       
                         
---> Its a comment not a part of the code
                </jbi:consumes>
        </jbi:services>
</jbi:jbi>

su-EIP-DispatcherService
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
        xmlns:eip="http://petals.ow2.org/components/eip/version-2"
        xmlns:generatedNs="http://localhost:8080/axis/"
        xmlns:jbi="http://java.sun.com/xml/ns/jbi"
        xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       
        <jbi:services binding-component="false">
                <jbi:provides
                        interface-name="generatedNs:dispatcher"
                        service-name="generatedNs:dispatcherService"
                        endpoint-name="dispatcherServiceEndpoint">
       
                       
                        <petalsCDK:timeout>30000</petalsCDK:timeout>
                        <petalsCDK:validate-wsdl>true</petalsCDK:validate-wsdl>
                        <petalsCDK:forward-security-subject>false</petalsCDK:forward-security-subject>
                        <petalsCDK:forward-message-properties>false</petalsCDK:forward-message-properties>
                        <petalsCDK:forward-attachments>false</petalsCDK:forward-attachments>
                        <petalsCDK:wsdl xsi:nil="true" />
               
                               
                        <eip:eip>dispatcher</eip:eip>
                        <eip:fault-robust>false</eip:fault-robust>
                        <eip:exception-robust>false</eip:exception-robust>
                        <eip:attachment-mode>false</eip:attachment-mode>
                </jbi:provides>
               
               
                <jbi:consumes
                        interface-name="iConsumeNsPrefix:Multi"
                        service-name="iConsumeNsPrefix:MultiService"
                        endpoint-name="Multi"
                        xmlns:iConsumeNsPrefix="http://localhost:8080/axis/Multi.jws">
                       
                       
                        <petalsCDK:timeout>30000</petalsCDK:timeout>
                        <petalsCDK:operation xmlns:mulNs="http://localhost:8080/axis/Multi.jws">mulNs:mul</petalsCDK:operation>
                        <petalsCDK:mep>InOnly</petalsCDK:mep>
                </jbi:consumes>
               
               
                <jbi:consumes
                        interface-name="iConsumeNsPrefix:Somme"
                        service-name="iConsumeNsPrefix:SommeService"
                        endpoint-name="Somme"
                        xmlns:iConsumeNsPrefix="http://localhost:8080/axis/Somme.jws">
                       
                       
                        <petalsCDK:timeout>30000</petalsCDK:timeout>
                        <petalsCDK:operation xmlns:addNs="http://localhost:8080/axis/Somme.jws">addNs:add</petalsCDK:operation>
                        <petalsCDK:mep>InOnly</petalsCDK:mep>
                </jbi:consumes>
        </jbi:services>
</jbi:jbi>
Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

Vincent Zurczak
Administrator
The consumes section in the router is wrong.
The namespace URI associated with the iConsumeNsPrefix prefix does not match the one declared in the dispatcher's jbi.xml.
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

jihad22
Hi,

It must be :

<jbi:consumes
                        interface-name="iConsumeNsPrefix:dispatcher"
                        service-name="iConsumeNsPrefix:dispatcherService"
                        endpoint-name="dispatcherServiceEndpoint"
                        <b>xmlns:iConsumeNsPrefix="http://localhost:8080/axis/">
                       
                       
                        <petalsCDK:timeout>30000</petalsCDK:timeout>
                        <petalsCDK:operation xmlns:addNs="http://localhost:8080/axis/Somme.jws">addNs:add</petalsCDK:operation>
                        <petalsCDK:mep>InOut</petalsCDK:mep> 
                </jbi:consumes>

Right???
Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

Vincent Zurczak
Administrator
Yes. Remember that service and interface names are qualified in WSDL.
The namespace URI is part of the names.
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

jihad22
But even if i corrected my jbi.xml, it still doesn't work:

I use add operation:
<add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>1</integer1>
<integer2>2</integer2>
</add>

For the error, i get something like this: time is not enough, it means that 30000 is not enough to get the awnser !!!!!!!

Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

Vincent Zurczak
Administrator
Here are the potential errors.

The router configuration has only one consume and one condition.
I assumed you had commented useless consumes, but maybe not (the studio could not have generated it, it would have signaled an error in the wizard).
#conditions = #consumes - 1

=> Try to remove the test.
But in this case, the router is useless.


Second thing: I had missed it, but you use a "test-operation" instead of a "test" in your router.
"test-operation" checks an operation name (qualified name).
"test" checks a XPath condition.

=> Replace test-operation by "test".


Eventually, the message's content is still not qualified and you use the XPath function local-name().
I talked about it in one of my previous messages.


In fact, before testing your touter, try to test your dispatcher alone.
Once the dispatcher works, fix the router. Thus, you will know where is the problem if one occurs.
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

jihad22
A new error occur :(:(:(:(:(

<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <faultcode>soapenv:Server</faultcode> 
    <faultstring>The Dispatcher pattern does not support http://www.w3.org/2004/08/wsdl/in-out pattern</faultstring> 
    <faultactor>http://petals.ow2.org/petals-se-eip</faultactor> 
    <detail> 
        <stackTrace>org.ow2.petals.component.framework.api.exception.SOAP11FaultServerException: The Dispatcher pattern does not support http://www.w3.org/2004/08/wsdl/in-out pattern
 
    at org.ow2.petals.component.framework.process.MessageExchangeProcessor.processInOutAsProvider(MessageExchangeProcessor.java:664)
 
    at org.ow2.petals.component.framework.process.MessageExchangeProcessor.processAsProvider(MessageExchangeProcessor.java:372)
 
    at org.ow2.petals.component.framework.process.MessageExchangeProcessor.process(MessageExchangeProcessor.java:234)
 
    at org.ow2.petals.component.framework.process.MessageExchangeProcessor.run(MessageExchangeProcessor.java:177)
 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 
    at java.lang.Thread.run(Thread.java:619)
 
Caused by: javax.jbi.messaging.MessagingException: The Dispatcher pattern does not support http://www.w3.org/2004/08/wsdl/in-out pattern
 
    at org.ow2.petals.se.eip.patterns.AbstractPattern.validateMEPPattern(AbstractPattern.java:269)
 
    at org.ow2.petals.se.eip.patterns.AbstractPattern.processPattern(AbstractPattern.java:67)
 
    at org.ow2.petals.se.eip.listener.JBIListener.process(JBIListener.java:138)
 
    at org.ow2.petals.se.eip.listener.JBIListener.onJBIMessage(JBIListener.java:105)
 
    at org.ow2.petals.component.framework.process.MessageExchangeProcessor.processInOutAsProvider(MessageExchangeProcessor.java:637)
 
    ... 6 more
 
</stackTrace> 
    </detail> 
</soapenv:Fault> 


I think it's a version problem, but i don't know where is the incompatibility????
Reply | Threaded
Open this post in threaded view
|

Re: EIP Router-Dispatcher

Mathieu Le Breton
Administrator
Hi,

"The Dispatcher pattern does not support
http://www.w3.org/2004/08/wsdl/in-out pattern"
It means you should use another message exchange pattern (MEP). Read the
SE-EIP documentation to see which MEP you should use with Dispatcher
pattern.
Petals Link