Question regarding sendToOutboundRouter method in AbstractService.java

View: New views
2 Messages — Rating Filter:   Alert me  

Question regarding sendToOutboundRouter method in AbstractService.java

by Marco Mascia-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We noticed that in mule 2.2.1 in the AbstractService.java class there is a method named sendToOutboundRouter which has the following check before it routes the event to the next endpoint defined in the pass-through-router

if (result != null && !event.isStopFurtherProcessing() && !(result.getPayload() instanceof NullPayload))

This check prevents the event being routed to the next endpoint when invoking with a NullPayload (method with empty parameters). Looks like this is a bug in mule and needs to be patched up. Does anyone know if there is a patch for this that we can use ?

Given below are the service and client configuration files


Client side configuration file


<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:spring="http://www.springframework.org/schema/beans"
        xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
        xmlns:tcp="http://www.mulesource.org/schema/mule/tcp/2.2"
        xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
        xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
        xmlns:test="http://www.mulesource.org/schema/mule/test/2.2"
        xsi:schemaLocation="
       http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
       http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd       
       http://www.mulesource.org/schema/mule/tcp/2.2 http://www.mulesource.org/schema/mule/tcp/2.2/mule-tcp.xsd
       http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd
       http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd
       http://www.mulesource.org/schema/mule/test/2.2 http://www.mulesource.org/schema/mule/test/2.2/mule-test.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

        <jms:connector name="JmsConnector"
                jndiProviderUrl="tcp://locahost:9711"
                connectionFactoryJndiName="TestQcf"
                jndiInitialFactory="com.tibco.tibjms.naming.TibjmsInitialContextFactory"
                username="test" password="test"
                acknowledgementMode="AUTO_ACKNOWLEDGE">
        </jms:connector>

        <byte-array-to-object-transformer name="bytearraytoobject" />
        <byte-array-to-serializable-transformer name="bytearraytoserializable" />
        <object-to-byte-array-transformer name="objectToByteArray" />
       
        <custom-transformer name="objecttojmsmessage"
                class="org.mule.transport.jms.transformers.ObjectToJMSMessage" />
        <custom-transformer name="jmsmessagetoobject"
                class="org.mule.transport.jms.transformers.JMSMessageToObject" />

        <vm:endpoint name="CustomerService" address="vm://CustomerService" synchronous="true">
                        <property key="interface"
                        value="com.xyz.CustomerService" />
        </vm:endpoint>

        <jms:endpoint name="CustomerService2"
                address="jms://Test" synchronous="true"
                connector-ref="JmsConnector" responseTimeout="360000"
                transformer-refs="objectToByteArray objecttojmsmessage"
                >

                <!--  <jms:transaction action="ALWAYS_BEGIN"/>-->


        </jms:endpoint>
        <model>
                <service name="CustomerServiceClient">
                        <inbound>
                                <inbound-endpoint ref="CustomerService" responseTransformer-refs="bytearraytoobject"/>
                        </inbound>
                       
                       
                        <outbound>
                       
                           <pass-through-router>
                           
                            <outbound-endpoint ref="CustomerService2">
                           
                            </outbound-endpoint>
                           </pass-through-router>
                        </outbound>
                </service>
        </model>

</mule>



Server side config file


<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:spring="http://www.springframework.org/schema/beans"
        xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
        xmlns:tcp="http://www.mulesource.org/schema/mule/tcp/2.2"
        xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
        xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
        xmlns:test="http://www.mulesource.org/schema/mule/test/2.2"
        xsi:schemaLocation="
       http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
       http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
       http://www.mulesource.org/schema/mule/tcp/2.2 http://www.mulesource.org/schema/mule/tcp/2.2/mule-tcp.xsd
       http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd
       http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd
       http://www.mulesource.org/schema/mule/test/2.2 http://www.mulesource.org/schema/mule/test/2.2/mule-test.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


        <jms:connector name="JmsConnector"
                jndiProviderUrl="tcp://localhost:9711"
                connectionFactoryJndiName="TestQcf"
                jndiInitialFactory="com.tibco.tibjms.naming.TibjmsInitialContextFactory"
                username="aaftestapp" password="test">

        </jms:connector>

        <byte-array-to-object-transformer name="bytearraytoobject" />
        <object-to-byte-array-transformer name="objectToByteArray" />
        <custom-transformer name="jmsmessagetoobject"
                class="org.mule.transport.jms.transformers.JMSMessageToObject" />
        <custom-transformer name="objecttojmsmessage"
                class="org.mule.transport.jms.transformers.ObjectToJMSMessage" />
        <payload-type-filter expectedType="java.lang.String"
                name="payloadfilter" />


        <model name="main">
        <default-service-exception-strategy>
                <outbound-endpoint address="jms://Test"></outbound-endpoint>
        </default-service-exception-strategy>
                <service name="CustomerService">
                        <inbound>
                                <jms:inbound-endpoint
                                        address="jms://Test"
                                        transformer-refs="jmsmessagetoobject bytearraytoobject"
                                        responseTransformer-refs="objectToByteArray objecttojmsmessage"
                                        synchronous="true" responseTimeout="1800000"
                                        connector-ref="JmsConnector">
                                        <!--   <filter ref="payloadfilter"/>-->

                                        <!--  <jms:transaction action="BEGIN_OR_JOIN"/>-->
                                        <property key="interface"
                                                value="com.xyz.CustomerService" />
                                </jms:inbound-endpoint>
                        </inbound>
                        <!-- TODO add your service component here. This can also be a Spring bean using <spring-object bean="name"/> -->
                        <component>
                                <singleton-object
                                        class="com.xyz.CustomerServiceImpl">
                                </singleton-object>
                        </component>

                </service>
        </model>
</mule>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Question regarding sendToOutboundRouter method in AbstractService.java

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Why is it a bug? Mule flows are revolving around messages and NullPayload is a special object denoting no message. So, what is there to route? Mule stops the flow.

HTH,
Andrew