hi all,
 i have posted a question on the mailing list about having  a bc calling a
se1 which in turn call se2.
I was using as bc file>:poller, which uses an inOnly message.... 
what i wanted to achieve is to have file:poller send a message to se1 which
in turn calls se2
I was suggested by Mr Chris Custine to try out eip:pipeline.....
i have tried it out.. the message arrives at destination but it seems that 
se1 is not being invoked.....
i got a disaster excepiton..
But first, here's the 3 xbean.xml i am using
-- BC --
[code]
<file:poller service="tut:file" 
                endpoint="poller"
                file="file:///c:/servicemix-projects/in/" 
                
             targetService="tut:pipeline">
        <property name="marshaler">
                             <bean
class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
                        </property>    
   </file:poller>
[/code]
---- Pipeline --
[code]
<beans xmlns:eip="http://servicemix.apache.org/eip/1.0";
       xmlns:tut="urn:servicemix:tutorial"
       xmlns:hwse="http://org.apache.servicemix.samples.helloworld.se/1.0"; 
       xmlns:xyz="http://companyxyz.com";
       xmlns:magent="http://org.apache.servicemix.samples.middleagent/1.0"; 
       xmlns:xxx="http://middleagent.com";>       
  
  
  <eip:pipeline service="tut:pipeline" endpoint="endpoint">
    <eip:transformer>
      <eip:exchange-target service="xxx:middleAgent" />
    </eip:transformer>
    <eip:target>
      <eip:exchange-target service="xyz:helloWorld" />
    </eip:target>
  </eip:pipeline>
[/code]
-- middleAgent, aka SE1
[code]
<beans xmlns:magent="http://org.apache.servicemix.samples.middleagent/1.0"; 
       xmlns:xxx="http://middleagent.com";>
  <magent:endpoint service="xxx:middleAgent" endpoint="middleAgent"/>
</beans>
[/code]
-- helloWorld, aka SE2 ----------------
[code] 
 <hwse:endpoint service="xyz:helloWorld" 
                endpoint="helloWorld">
        <property name="externalBean">
          <bean id="myBean" class="org.apache.servicemix.samples.beans.MyBean" 
/> 
        </property>
  </hwse:endpoint>
[/code]
i am receiving this bad exception..
[code]
INFO  - AutoDeploymentService          - Directory: hotdeploy: Finished
installa
tion of archive:  tutorial-sa-1.0-SNAPSHOT.jar
ERROR - MyComponent                    - Error processing exchange InOut[
  id: ID:192.168.0.2-117dc6d95d5-9:0
  status: Active
  role: provider
  service: {http://middleagent.com}middleAgent
  endpoint: middleAgent
  in: null
  out: null
]
java.lang.IllegalStateException: component is not owner
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setProperty(M
essageExchangeImpl.java:403)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(Delivery
ChannelImpl.java:428)
        at
org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDel
iveryChannel.java:79)
        at
org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndp
oint.java:67)
        at
org.apache.servicemix.common.endpoints.ProviderEndpoint.process(Provi
derEndpoint.java:114)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:490)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)
---- Yeah we got it!!!
ERROR - MyComponent                    - Error setting exchange status to
ERROR
java.lang.IllegalStateException: component is not owner when trying to set
error
: java.lang.IllegalStateException: component is not owner
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(Mess
ageExchangeImpl.java:264)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:57)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException: component is not owner
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setProperty(M
essageExchangeImpl.java:403)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(Delivery
ChannelImpl.java:428)
        at
org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDel
iveryChannel.java:79)
        at
org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndp
oint.java:67)
        at
org.apache.servicemix.common.endpoints.ProviderEndpoint.process(Provi
derEndpoint.java:114)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:490)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
        ... 7 more
And this comes from MyBean:foobar
[/code]

for reference, here's code of my MiddleAgent SE
[code]

public class MyEndpoint extends ProviderEndpoint {

    public void validate() throws DeploymentException {
    }

    protected void processInOut(MessageExchange exchange, NormalizedMessage
in, NormalizedMessage out) throws Exception {
            System.err.println("---- processing inout ----");
            if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
            out.setContent(in.getContent());
            getChannel().send(exchange);
        }
    }

}
[/code]

and htis is the code in SE2 (HelloWorld)
[code]
    protected void processInOnly(MessageExchange exchange, NormalizedMessage
in) throws Exception {
                System.err.println("---- Yeah we got it!!!");
                System.err.println("And this comes from MyBean:" +
myBean.getFoobar());
    }
[/code]

Anyone could tell me what i am missing?
>From my understanding of the description of the pipeline
The Pipeline component is a bridge between an In-Only (or Robust-In-Only)
MEP and an In-Out MEP. When the Pipeline receives an In-Only MEP, it will
send the input in an In-Out MEP to the tranformer destination and forward
the response in an In-Only MEP to the target destination.


i guessed that a BC send an InOnly message to hte pipeline, which will make
an InOut message and forward it. the reply of which will be sent to an
InOnly 'destination'
so i guessed that, if i have BC-->SE1-->SE2 
SE1 will have a processInOut while SE2 will have a processInOnly...
is that undestanding correct?

thanks in advance and regards
 marco

  




-- 
View this message in context: 
http://www.nabble.com/eip%3Apipeline-error-tp15248749s12049p15248749.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to