You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by pgodot <pg...@temenos.com> on 2006/05/18 19:14:39 UTC

RemoteServiceMixClient - EIP component - done an IOMEX

Yop SM Comunity,

I have a small problem with EIP component when I try to done my InOut
Message Exchange. I configure a RemoteSMClient object in my application
which send am IO message to a EIP configure to trace the message and send to
another component the message. Everything ges well, except when I try to
send the DONE status form my remoteSMClient. The remote SM embedded with my
RemoteSMClient send me the error one done action :

 3580558 [Thread-11] ERROR org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow
null - Caught an exception routing ExchangePacket
Throwable : javax.jbi.messaging.MessagingException: No component named
ofsmlTester - Couldn't route MessageExchange...
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:180)

I trace a bit more the context to see difference between send action and
done action. I add the line:
log.debug("Called Flow doRouting For " + id.getName() + " Destination " +
me.getDestinationId() + " role : " + me.getRole() + "Endpoint  " +
me.getEndpoint() + "Source Id: " + me.getSourceId());

Send: in AbstractFlow.doRouting method I have :
Called Flow doRouting For ID:homework-4519-1147970921380-0:0 Destination
[container=ServiceMix,name=myEip] role : ConsumerEndpoint 
ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]Source Id:
[container=ServiceMix,name=ID:homework-4519-1147970921380-0:0]
and the lcc is not null.

Done: in AbstractFlow.doRouting method I have :
Called Flow doRouting For ofsmlTester Destination
[container=ServiceMix,name=ofsmlTester] role : ProviderEndpoint 
ServiceEndpoint[service=ofsml,endpoint=ofsmlTester]Source Id:
[container=ServiceMix,name=myEip]
and the lcc object is null

I suspect EIP to put a bad sourceId in the IOMex. 

If you have an idea, "Guillaume", you are welcome.

Tomorrow, I will without the RemoteSMClient Object.

Thanks,
Phil



--
View this message in context: http://www.nabble.com/RemoteServiceMixClient---EIP-component---done-an-IOMEX-t1644809.html#a4455054
Sent from the ServiceMix - User forum at Nabble.com.


Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by Guillaume Nodet <gn...@gmail.com>.
That' s what i understood.
The DefaultServicemixClient is not meant to be use with an embeded jbi
container, so there is no need to stop the container when the client is
stopped.  But the RemoveServiceMixClient does exactly that.

Cheers,
Guillaume Nodet

On 5/24/06, pgodot <pg...@temenos.com> wrote:
>
>
> Sorry if i'm not clear,
>
> I spoke of the JBI Container embeded in the client which not stopped on
> stop
> command.
>
> Thanks,
> Phil
> --
> View this message in context:
> http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4538306
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by pgodot <pg...@temenos.com>.
Sorry if i'm not clear,

I spoke of the JBI Container embeded in the client which not stopped on stop
command.

Thanks,
Phil
--
View this message in context: http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4538306
Sent from the ServiceMix - User forum at Nabble.com.


Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by Guillaume Nodet <gn...@gmail.com>.
I do not understand the problem with the stop.
The DefaultServiceMixClient should not stop the jbi container as it is just
a client.
This is the purpose of the remote client (I will fix it asap).

Cheers,
Guillaume Nodet

On 5/24/06, pgodot <pg...@temenos.com> wrote:
>
>
> Hi Guillaume,
>
> I posted two new JIRA:
> - same name between remote client and SM agent cause problem
> - stop command doesn't work for client.
>
> I have at least one problem, is if we stop the agent and restart it the
> message workflow is not goes well. It seems that queue in ActiveMQ are not
> well configure. the client post well the message in its queue but the
> agent
> never read it. Maybe not the same queue ...
>
> Is activeMq expert could check?
>
> Thanks,
> Phil
> --
> View this message in context:
> http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4537552
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by pgodot <pg...@temenos.com>.
Hi Guillaume,

I posted two new JIRA:
 - same name between remote client and SM agent cause problem
 - stop command doesn't work for client.

I have at least one problem, is if we stop the agent and restart it the
message workflow is not goes well. It seems that queue in ActiveMQ are not
well configure. the client post well the message in its queue but the agent
never read it. Maybe not the same queue ...

Is activeMq expert could check?

Thanks,
Phil
--
View this message in context: http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4537552
Sent from the ServiceMix - User forum at Nabble.com.


Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by Guillaume Nodet <gn...@gmail.com>.
Sorry about all these problems.
Could you raise a JIRA about that, I will improve things as you suggested.

Cheers,
Guillaume Nodet

On 5/23/06, pgodot <pg...@temenos.com> wrote:
>
>
> Hi SM Com and Guillaume,
>
> I hope I found my problem. It cames form the fact that my two JBI
> container,
> client and remote, had the same name, Default name = ServiceMix.
>
> I replace my client code to initialize my DefaultServiceMixClient by :
>                                         container = new JBIContainer();
>
>                                         Flow flow = new JMSFlow();
>                                         logTech.trace(" JMS Url : " +
> ((JMSFlow) flow).getJmsURL());
>
>                                         // container.setFlow(flow);
>                                         container.setFlowName("jms");
>
>
> container.setMonitorDeploymentDirectory(false);
>
> container.setMonitorInstallationDirectory(false);
>                                         container.setName("client");
>                                         container.setRmiPort(1111);
>                                         container.init();
>                                         container.start();
>                                         logTech.trace(" JMS Url : "
>                                                         + ((JMSFlow)
> container.getFlow()).getJmsURL());
>
>                                         jbi = new
> DefaultServiceMixClient(container);
>
> Where I setted a name of the container to "client" (maybe not
> recommended).
>
> And everything starting to re-work.
>
> Now quick questions,
>
> For the agent:
> Why the name of my agent is not jbi like it's specify in my servicemix.xml
> by the attribute id?
> Does exist another attribute to set a name of the container with
> service.xml
> file?
>
> For the client:
> Is it possible with the API to change the container name? Do we calculate
> it
> like the component name something like homework-2333-1148417959725-9:0?
>
> Thanks again for your help and encouragement Guillaume,
> Hope we continue to use SM,
> Regards,
> Phil
> --
> View this message in context:
> http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4531102
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by pgodot <pg...@temenos.com>.
Hi SM Com and Guillaume,

I hope I found my problem. It cames form the fact that my two JBI container,
client and remote, had the same name, Default name = ServiceMix.

I replace my client code to initialize my DefaultServiceMixClient by :
					container = new JBIContainer();

					Flow flow = new JMSFlow();
					logTech.trace(" JMS Url : " + ((JMSFlow) flow).getJmsURL());
	
					// container.setFlow(flow);
					container.setFlowName("jms");
	
					container.setMonitorDeploymentDirectory(false);
					container.setMonitorInstallationDirectory(false);
					container.setName("client");
					container.setRmiPort(1111);
					container.init();
					container.start();
					logTech.trace(" JMS Url : "
							+ ((JMSFlow) container.getFlow()).getJmsURL());
	
					jbi = new DefaultServiceMixClient(container);

Where I setted a name of the container to "client" (maybe not recommended).

And everything starting to re-work.

Now quick questions, 

For the agent:
Why the name of my agent is not jbi like it's specify in my servicemix.xml
by the attribute id?
Does exist another attribute to set a name of the container with service.xml
file?

For the client:
Is it possible with the API to change the container name? Do we calculate it
like the component name something like homework-2333-1148417959725-9:0?

Thanks again for your help and encouragement Guillaume,
Hope we continue to use SM,
Regards,
Phil
--
View this message in context: http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4531102
Sent from the ServiceMix - User forum at Nabble.com.


Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by Guillaume Nodet <gn...@gmail.com>.
On 5/22/06, pgodot <pg...@temenos.com> wrote:
>
>
> Thanks Guillaume,
>
> I did some test but sleep() doesn't resolve the problem. I don't think it
> come from a init/start synchronization. I removed the eip and call
> directly
> my remote component and I had the same behavior. We can remove EIP form
> the
> picture.


I was not talking about the EIP component, but about the remote client which
takes some times before  discovering the  other servicemix.

I'm suspecting something wrong in the JMS Flow, configuration, client usage,


Try to step by step your test code.  You should see something in the log
when the jms brokers discover each other.

...
>
> I will continue to check to raise the good Jira.
>
> Could we put RemoteSMClient object in static? is it Thread Safe?


The remote client should be thread safe.  The only problem is if you want to
use asynchonous sends with InOut MEPs.

Cheers,
Guillaume Nodet

Thanks for your help,
> Phil
>
> --
> View this message in context:
> http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4508216
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by pgodot <pg...@temenos.com>.
Thanks Guillaume,

I did some test but sleep() doesn't resolve the problem. I don't think it
come from a init/start synchronization. I removed the eip and call directly
my remote component and I had the same behavior. We can remove EIP form the
picture.

I'm suspecting something wrong in the JMS Flow, configuration, client usage,
...

I will continue to check to raise the good Jira.

Could we put RemoteSMClient object in static? is it Thread Safe?

Thanks for your help,
Phil
 
--
View this message in context: http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4508216
Sent from the ServiceMix - User forum at Nabble.com.


Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by Guillaume Nodet <gn...@gmail.com>.
I think you have  a timing issue.
The remove client uses an ActiveMQ embedded broker with multicast discovery.
In effects, it creates a simple JBI container which is clustered with the
main container.
The problem is that when you init/start the remote client, the call does not
block until the container is discovered.  Try putting a sleep() after the
jbi.start() call.
Could you raise a JIRA issue and will add a blocking (with timeout) start
method.

The remote client is quite heavyweight so you should not create/destroy it
each time you need it.

Cheers,
Guillaume Nodet

On 5/22/06, pgodot <pg...@temenos.com> wrote:
>
>
> Hi Guillaume,
>
> I checked my code and do a simple test case.
>
> My SM is configure by service.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
>         xmlns:eip="http://servicemix.apache.org/eip/1.0">
> <sm:container id="jbi"
>                 flowName="jms"
>                 createMBeanServer="true" dumpStats="true"
> statsInterval="10" >
> <sm:activationSpecs>
> <sm:activationSpec componentName="myEip"
>                                 service="test:myEip">
>                                 <sm:component>
>                                         <eip:component>
>                                                 <eip:endpoints>
>                                                         <!--
>                                                         <eip:static-routing-slip
> service="test:routingSlip"
> endpoint="endpoint">
>                                                           <eip:targets>
>                                                                 <eip:exchange-target
> service="test:echo" />
>                                                                 <eip:exchange-target
> service="test:trace1" />
>                                                         </eip:targets>
>
>                                                         </eip:static-routing-slip>
>                                                         -->
>                                                         <!-- generate a
> javax.jbi.messaging.MessagingException: illegal
> exchange status: done on trace component -->
>                                                         <eip:wire-tap
> service="tem:tagAPIBC" endpoint="endpoint">
>                                                           <eip:target>
>                                                             <eip:exchange-target
> service="test:echo" />
>                                                           </eip:target>
>                                                           <eip:inListener>
>                                                             <eip:exchange-target
> service="test:trace" />
>
>                                                           </eip:inListener>
>
>                                                         </eip:wire-tap>
>
>                                                 </eip:endpoints>
>                                         </eip:component>
>                                 </sm:component>
>                         </sm:activationSpec>
>                         <sm:activationSpec componentName="echo"
>                                 service="test:echo">
>                                 <sm:component>
>                                         <bean xmlns="
> http://xbean.org/schemas/spring/1.0"
>                                                 class="
> org.apache.servicemix.components.util.EchoComponent">
>
>                                         </bean>
>                                 </sm:component>
>                         </sm:activationSpec>
>                         <sm:activationSpec componentName="trace"
> service="test:trace">
>                                 <sm:component>
>                                         <bean xmlns="
> http://xbean.org/schemas/spring/1.0"
>                                                 class="
> org.apache.servicemix.components.util.TraceComponent">
>                                         </bean>
>                                 </sm:component>
>                         </sm:activationSpec>
>     </sm:activationSpecs>
>   </sm:container>
>         <!-- the work manager (thread pool) for this container -->
>         <bean id="workManager"
>                 class="org.jencks.factory.WorkManagerFactoryBean">
>                 <property name="threadPoolSize" value="30" />
>         </bean>
>
> </beans>
>
>
> Simple wiretap configuration.
>
>
> My java code is:
> public class SampleEIP {
>         private static DefaultServiceMixClient jbi = null;
>
>         public void initialize(){
>                  try {
>                                 jbi = new RemoteServiceMixClient();
>
>                                 ((RemoteServiceMixClient)jbi).init();
>                                 jbi.start();
>                         } catch (JBIException e) {
>                                 e.printStackTrace();
>                         }
>
>
>         }
>
>         public static void main(String[] args) {
>                 SampleEIP test = new SampleEIP();
>                 test.initialize();
>                 test.send();
>                 test.stop();
>         }
>
>         private void stop() {
>                 try {
>                         jbi.stop();
>                 } catch (JBIException e) {
>                         e.printStackTrace();
>                 }
>
>         }
>         private void send() {
>                 // InOnly exchange = jbi.createInOnlyExchange();
>                 try{
>                         InOut exchange = jbi.createInOutExchange();
>
>                         NormalizedMessage inMessage =
> exchange.getInMessage();
>                         inMessage.setContent(new
> StringSource("<in>Message</in>"));
>                         QName service = new QName("tagAPIBC");
>                         exchange.setService(service);
>                         boolean bRet=jbi.sendSync(exchange);
>                         if (bRet = true){
>                                 NormalizedMessage recieved=
> exchange.getMessage("out");
>                                 //InOut recieved = (InOut) jbi.receive
> (1000);
>                                 if (recieved!=null){
>                                         System.out.println(" Throw a done
> message");
>                                         jbi.done(exchange);
>                                 }else{
>                                         System.out.println("recieved is
> null");
>                                 }
>                         }else {
>                                 System.out.println("sendSync is false");
>                         }
>                 }catch(Exception e){
>                         e.printStackTrace();
>                 }
>         }
>
>
> }
>
>
> My log file in debug level for the client:
> 15:31:16,493 INFO  JMSFlow ServiceMix: Starting jms flow [main      ]
> (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:273)
> 15:31:16,633 INFO  JMSFlow ServiceMix: adding remote endpoint:
> ServiceEndpoint[service=ofsml,endpoint=ofsmlTester] [ssion Task]
> (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444)
> 15:31:16,649 INFO  JMSFlow ServiceMix: adding remote endpoint:
> ServiceEndpoint[service=tagAPIBC,endpoint=endpoint] [ssion Task]
> (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444)
> 15:31:16,649 INFO  JMSFlow ServiceMix: adding remote endpoint:
> ServiceEndpoint[service=trace,endpoint=trace] [ssion Task]
> (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444)
> 15:31:16,665 INFO  JMSFlow ServiceMix: adding remote endpoint:
> ServiceEndpoint[service=echo,endpoint=echo] [ssion Task]
> (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444)
> Role : Provider destinationId : null
> 15:31:22,493 DEBUG Broker Routing exchange
> org.apache.servicemix.jbi.messaging.InOutImpl@1071e12 to:
> ServiceEndpoint[service=tagAPIBC,endpoint=endpoint] [main      ]
> (org.apache.servicemix.jbi.nmr.Broker:389)
> Role : Provider destinationId : null endpoint
> :ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]
> 15:31:22,493 DEBUG AbstractFlow Called Flow send [main      ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116)
> 15:31:22,946 DEBUG AbstractFlow Called Flow doRouting  [Thread-7  ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165)
> 15:31:22,993 DEBUG AbstractFlow Called Flow doRouting For myEip
> Destination
> [container=ServiceMix,name=echo] role : ConsumerEndpoint
> ServiceEndpoint[service=echo,endpoint=echo]Source Id:
> [container=ServiceMix,name=myEip] [Thread-7  ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168)
> 15:31:22,993 ERROR JMSFlow$5 Caught an exception routing ExchangePacket:
> [Thread-7  ] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:536)
> javax.jbi.messaging.MessagingException: No component named myEip -
> Couldn't
> route MessageExchange org.apache.servicemix.jbi.messaging.InOutImpl@8aaff4
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> AbstractFlow.java:180)
>         at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.access$3(
> JMSFlow.java:1)
>         at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow$5.run(
> JMSFlow.java:534)
>         at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
>         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
> (Unknown
> Source)
>         at java.lang.Thread.run(Thread.java:595)
>
> The server log :
> 15:48:17,711 INFO  JMSFlow ServiceMix: Starting jms flow [main      ]
> (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:273)
> 15:48:17,758 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=ofsml,endpoint=ofsmlTester]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:17,805 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:17,821 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=trace,endpoint=trace]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:17,836 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=echo,endpoint=echo]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:24,368 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=ofsml,endpoint=ofsmlTester]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:24,383 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:24,383 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=trace,endpoint=trace]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:24,399 INFO  JMSFlow ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent
> [source=ServiceEndpoint[service=echo,endpoint=echo]]
> [ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388)
> 15:48:29,711 DEBUG AbstractFlow Called Flow doRouting  [Thread-8  ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165)
> 15:48:29,711 DEBUG AbstractFlow Called Flow doRouting For myEip
> Destination
> [container=ServiceMix,name=myEip] role : ProviderEndpoint
> ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]Source Id:
> [container=ServiceMix,name=ID:chdsk-pgodot-1501-1148305701258-0:0]
> [Thread-8
> ] (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168)
> 15:48:29,727 DEBUG BaseLifeCycle Received exchange: status: Active, role:
> Provider [2-thread-2] (org.apache.servicemix.eip.EIPSpringComponent:363)
> 15:48:29,727 DEBUG MemoryStore Storing object with id:
> ID:chdsk-pgodot-1501-1148305701258-9:0 [2-thread-2]
> (org.apache.servicemix.store.memory.MemoryStore:50)
> Role : Provider destinationId : null
> 15:48:29,743 DEBUG Broker Routing exchange
> org.apache.servicemix.jbi.messaging.InOnlyImpl@2f54 to:
> ServiceEndpoint[service=trace,endpoint=trace] [2-thread-2]
> (org.apache.servicemix.jbi.nmr.Broker:389)
> Role : Provider destinationId : null endpoint
> :ServiceEndpoint[service=trace,endpoint=trace]
> 15:48:29,743 DEBUG AbstractFlow Called Flow send [2-thread-2]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116)
> Role : Provider destinationId : null
> 15:48:29,758 DEBUG Broker Routing exchange
> org.apache.servicemix.jbi.messaging.InOutImpl@134ae32 to:
> ServiceEndpoint[service=echo,endpoint=echo] [2-thread-2]
> (org.apache.servicemix.jbi.nmr.Broker:389)
> Role : Provider destinationId : null endpoint
> :ServiceEndpoint[service=echo,endpoint=echo]
> 15:48:29,774 DEBUG AbstractFlow Called Flow doRouting  [Thread-9  ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165)
> 15:48:29,774 DEBUG AbstractFlow Called Flow doRouting For trace
> Destination
> [container=ServiceMix,name=trace] role : ProviderEndpoint
> ServiceEndpoint[service=trace,endpoint=trace]Source Id:
> [container=ServiceMix,name=myEip] [Thread-9  ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168)
> 15:48:29,774 DEBUG AbstractFlow Called Flow send [2-thread-2]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116)
> 15:48:29,774 INFO  TraceComponent Exchange:
> org.apache.servicemix.jbi.messaging.InOnlyImpl@e7fd03 received IN message:
>
> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@93f13f{properties
> :
> {}} [Thread-9  ] (org.apache.servicemix.components.util.TraceComponent:63)
> 15:48:29,774 INFO  TraceComponent Body is: <in>Message</in> [Thread-9  ]
> (org.apache.servicemix.components.util.TraceComponent:65)
> Role : Consumer destinationId : [container=ServiceMix,name=trace]
> Role : Consumer destinationId : [container=ServiceMix,name=trace] endpoint
> :ServiceEndpoint[service=trace,endpoint=trace]
> 15:48:29,774 DEBUG AbstractFlow Called Flow send [Thread-9  ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116)
> 15:48:29,805 DEBUG AbstractFlow Called Flow doRouting  [Thread-10 ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165)
> 15:48:29,805 DEBUG AbstractFlow Called Flow doRouting  [Thread-11 ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165)
> 15:48:29,805 DEBUG AbstractFlow Called Flow doRouting For echo Destination
> [container=ServiceMix,name=echo] role : ProviderEndpoint
> ServiceEndpoint[service=echo,endpoint=echo]Source Id:
> [container=ServiceMix,name=myEip] [Thread-10 ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168)
> 15:48:29,805 DEBUG AbstractFlow Called Flow doRouting For myEip
> Destination
> [container=ServiceMix,name=trace] role : ConsumerEndpoint
> ServiceEndpoint[service=trace,endpoint=trace]Source Id:
> [container=ServiceMix,name=myEip] [Thread-11 ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168)
> 15:48:29,805 INFO  EchoComponent Echoed back message:
>
> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@dea768{properties
> :
> {}} [Thread-10 ] (org.apache.servicemix.components.util.EchoComponent:36)
> Role : Consumer destinationId : [container=ServiceMix,name=echo]
> Role : Consumer destinationId : [container=ServiceMix,name=echo] endpoint
> :ServiceEndpoint[service=echo,endpoint=echo]
> 15:48:29,821 DEBUG AbstractFlow Called Flow send [Thread-10 ]
> (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116)
> 15:48:29,821 DEBUG BaseLifeCycle Received exchange: status: Done, role:
> Consumer [2-thread-2] (org.apache.servicemix.eip.EIPSpringComponent:363)
>
>
> This test case works 1/5 times. :-( but the method stop on jbi object
> never
> stop JMS thread !!!!
>
> --
> View this message in context:
> http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4505615
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by pgodot <pg...@temenos.com>.
Hi Guillaume,

I checked my code and do a simple test case.

My SM is configure by service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
	xmlns:eip="http://servicemix.apache.org/eip/1.0">
<sm:container id="jbi" 
                flowName="jms"
		createMBeanServer="true" dumpStats="true" statsInterval="10" >
<sm:activationSpecs>
<sm:activationSpec componentName="myEip"
				service="test:myEip">
		        	<sm:component>
          				<eip:component>
            					<eip:endpoints>
            						<!--
	            					<eip:static-routing-slip service="test:routingSlip"
endpoint="endpoint">
							  <eip:targets>
	    							<eip:exchange-target service="test:echo" />
	    							<eip:exchange-target service="test:trace1" />
	  						</eip:targets>
							</eip:static-routing-slip>
							-->
							<!-- generate a javax.jbi.messaging.MessagingException: illegal
exchange status: done on trace component -->
							<eip:wire-tap service="tem:tagAPIBC" endpoint="endpoint">
							  <eip:target>
							    <eip:exchange-target service="test:echo" />
							  </eip:target>
							  <eip:inListener>
							    <eip:exchange-target service="test:trace" />
							  </eip:inListener>
							  
							</eip:wire-tap>
							
						</eip:endpoints>
					</eip:component>
				</sm:component>
			</sm:activationSpec>
			<sm:activationSpec componentName="echo"
				service="test:echo">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0"
						class="org.apache.servicemix.components.util.EchoComponent">
						
					</bean>
				</sm:component>
			</sm:activationSpec>
    			<sm:activationSpec componentName="trace" service="test:trace">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0"
						class="org.apache.servicemix.components.util.TraceComponent">
					</bean>
				</sm:component>
			</sm:activationSpec>
    </sm:activationSpecs>
  </sm:container>
	<!-- the work manager (thread pool) for this container -->
	<bean id="workManager"
		class="org.jencks.factory.WorkManagerFactoryBean">
		<property name="threadPoolSize" value="30" />
	</bean>
  
</beans>


Simple wiretap configuration.


My java code is:
public class SampleEIP {
	private static DefaultServiceMixClient jbi = null;
	
	public void initialize(){
		 try {
				jbi = new RemoteServiceMixClient();
				
				((RemoteServiceMixClient)jbi).init();
				jbi.start();
			} catch (JBIException e) {
				e.printStackTrace();
			}

		
	}
	
	public static void main(String[] args) {
		SampleEIP test = new SampleEIP();
		test.initialize();
		test.send();
		test.stop();
	}

	private void stop() {
		try {
			jbi.stop();
		} catch (JBIException e) {
			e.printStackTrace();
		}
		
	}
	private void send() {
		// InOnly exchange = jbi.createInOnlyExchange();
		try{
			InOut exchange = jbi.createInOutExchange();
	
			NormalizedMessage inMessage = exchange.getInMessage();
			inMessage.setContent(new StringSource("<in>Message</in>"));
			QName service = new QName("tagAPIBC");
			exchange.setService(service);
			boolean bRet=jbi.sendSync(exchange);
			if (bRet = true){
				NormalizedMessage recieved=exchange.getMessage("out");
				//InOut recieved = (InOut) jbi.receive(1000);
				if (recieved!=null){
					System.out.println(" Throw a done message");
					jbi.done(exchange);
				}else{
					System.out.println("recieved is null");
				}
			}else {
				System.out.println("sendSync is false");
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}


}


My log file in debug level for the client:
15:31:16,493 INFO  JMSFlow ServiceMix: Starting jms flow [main      ]
(org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:273) 
15:31:16,633 INFO  JMSFlow ServiceMix: adding remote endpoint:
ServiceEndpoint[service=ofsml,endpoint=ofsmlTester] [ssion Task]
(org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444) 
15:31:16,649 INFO  JMSFlow ServiceMix: adding remote endpoint:
ServiceEndpoint[service=tagAPIBC,endpoint=endpoint] [ssion Task]
(org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444) 
15:31:16,649 INFO  JMSFlow ServiceMix: adding remote endpoint:
ServiceEndpoint[service=trace,endpoint=trace] [ssion Task]
(org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444) 
15:31:16,665 INFO  JMSFlow ServiceMix: adding remote endpoint:
ServiceEndpoint[service=echo,endpoint=echo] [ssion Task]
(org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:444) 
 Role : Provider destinationId : null
15:31:22,493 DEBUG Broker Routing exchange
org.apache.servicemix.jbi.messaging.InOutImpl@1071e12 to:
ServiceEndpoint[service=tagAPIBC,endpoint=endpoint] [main      ]
(org.apache.servicemix.jbi.nmr.Broker:389) 
 Role : Provider destinationId : null endpoint
:ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]
15:31:22,493 DEBUG AbstractFlow Called Flow send [main      ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116) 
15:31:22,946 DEBUG AbstractFlow Called Flow doRouting  [Thread-7  ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165) 
15:31:22,993 DEBUG AbstractFlow Called Flow doRouting For myEip Destination
[container=ServiceMix,name=echo] role : ConsumerEndpoint 
ServiceEndpoint[service=echo,endpoint=echo]Source Id:
[container=ServiceMix,name=myEip] [Thread-7  ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168) 
15:31:22,993 ERROR JMSFlow$5 Caught an exception routing ExchangePacket: 
[Thread-7  ] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:536) 
javax.jbi.messaging.MessagingException: No component named myEip - Couldn't
route MessageExchange org.apache.servicemix.jbi.messaging.InOutImpl@8aaff4
	at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:180)
	at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.access$3(JMSFlow.java:1)
	at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow$5.run(JMSFlow.java:534)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
	at java.lang.Thread.run(Thread.java:595)

The server log :
15:48:17,711 INFO  JMSFlow ServiceMix: Starting jms flow [main      ]
(org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:273) 
15:48:17,758 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=ofsml,endpoint=ofsmlTester]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:17,805 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:17,821 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=trace,endpoint=trace]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:17,836 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=echo,endpoint=echo]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:24,368 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=ofsml,endpoint=ofsmlTester]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:24,383 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:24,383 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=trace,endpoint=trace]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:24,399 INFO  JMSFlow ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=echo,endpoint=echo]]
[ssion Task] (org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow:388) 
15:48:29,711 DEBUG AbstractFlow Called Flow doRouting  [Thread-8  ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165) 
15:48:29,711 DEBUG AbstractFlow Called Flow doRouting For myEip Destination
[container=ServiceMix,name=myEip] role : ProviderEndpoint 
ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]Source Id:
[container=ServiceMix,name=ID:chdsk-pgodot-1501-1148305701258-0:0] [Thread-8 
] (org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168) 
15:48:29,727 DEBUG BaseLifeCycle Received exchange: status: Active, role:
Provider [2-thread-2] (org.apache.servicemix.eip.EIPSpringComponent:363) 
15:48:29,727 DEBUG MemoryStore Storing object with id:
ID:chdsk-pgodot-1501-1148305701258-9:0 [2-thread-2]
(org.apache.servicemix.store.memory.MemoryStore:50) 
 Role : Provider destinationId : null
15:48:29,743 DEBUG Broker Routing exchange
org.apache.servicemix.jbi.messaging.InOnlyImpl@2f54 to:
ServiceEndpoint[service=trace,endpoint=trace] [2-thread-2]
(org.apache.servicemix.jbi.nmr.Broker:389) 
 Role : Provider destinationId : null endpoint
:ServiceEndpoint[service=trace,endpoint=trace]
15:48:29,743 DEBUG AbstractFlow Called Flow send [2-thread-2]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116) 
 Role : Provider destinationId : null
15:48:29,758 DEBUG Broker Routing exchange
org.apache.servicemix.jbi.messaging.InOutImpl@134ae32 to:
ServiceEndpoint[service=echo,endpoint=echo] [2-thread-2]
(org.apache.servicemix.jbi.nmr.Broker:389) 
 Role : Provider destinationId : null endpoint
:ServiceEndpoint[service=echo,endpoint=echo]
15:48:29,774 DEBUG AbstractFlow Called Flow doRouting  [Thread-9  ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165) 
15:48:29,774 DEBUG AbstractFlow Called Flow doRouting For trace Destination
[container=ServiceMix,name=trace] role : ProviderEndpoint 
ServiceEndpoint[service=trace,endpoint=trace]Source Id:
[container=ServiceMix,name=myEip] [Thread-9  ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168) 
15:48:29,774 DEBUG AbstractFlow Called Flow send [2-thread-2]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116) 
15:48:29,774 INFO  TraceComponent Exchange:
org.apache.servicemix.jbi.messaging.InOnlyImpl@e7fd03 received IN message:
org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@93f13f{properties:
{}} [Thread-9  ] (org.apache.servicemix.components.util.TraceComponent:63) 
15:48:29,774 INFO  TraceComponent Body is: <in>Message</in> [Thread-9  ]
(org.apache.servicemix.components.util.TraceComponent:65) 
 Role : Consumer destinationId : [container=ServiceMix,name=trace]
 Role : Consumer destinationId : [container=ServiceMix,name=trace] endpoint
:ServiceEndpoint[service=trace,endpoint=trace]
15:48:29,774 DEBUG AbstractFlow Called Flow send [Thread-9  ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116) 
15:48:29,805 DEBUG AbstractFlow Called Flow doRouting  [Thread-10 ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165) 
15:48:29,805 DEBUG AbstractFlow Called Flow doRouting  [Thread-11 ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:165) 
15:48:29,805 DEBUG AbstractFlow Called Flow doRouting For echo Destination
[container=ServiceMix,name=echo] role : ProviderEndpoint 
ServiceEndpoint[service=echo,endpoint=echo]Source Id:
[container=ServiceMix,name=myEip] [Thread-10 ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168) 
15:48:29,805 DEBUG AbstractFlow Called Flow doRouting For myEip Destination
[container=ServiceMix,name=trace] role : ConsumerEndpoint 
ServiceEndpoint[service=trace,endpoint=trace]Source Id:
[container=ServiceMix,name=myEip] [Thread-11 ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:168) 
15:48:29,805 INFO  EchoComponent Echoed back message:
org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@dea768{properties:
{}} [Thread-10 ] (org.apache.servicemix.components.util.EchoComponent:36) 
 Role : Consumer destinationId : [container=ServiceMix,name=echo]
 Role : Consumer destinationId : [container=ServiceMix,name=echo] endpoint
:ServiceEndpoint[service=echo,endpoint=echo]
15:48:29,821 DEBUG AbstractFlow Called Flow send [Thread-10 ]
(org.apache.servicemix.jbi.nmr.flow.AbstractFlow:116) 
15:48:29,821 DEBUG BaseLifeCycle Received exchange: status: Done, role:
Consumer [2-thread-2] (org.apache.servicemix.eip.EIPSpringComponent:363) 


This test case works 1/5 times. :-( but the method stop on jbi object never
stop JMS thread !!!!

--
View this message in context: http://www.nabble.com/RemoteServiceMixClient+-+EIP+component+-+done+an+IOMEX-t1644809.html#a4505615
Sent from the ServiceMix - User forum at Nabble.com.


Re: RemoteServiceMixClient - EIP component - done an IOMEX

Posted by Guillaume Nodet <gn...@gmail.com>.
It seems fine to me.
Did you had any success with that issue ?
Else could you setup a simple test case or send the full log at DEBUG level
?

Cheers,
Guillaume Nodet

On 5/18/06, pgodot <pg...@temenos.com> wrote:
>
>
> Yop SM Comunity,
>
> I have a small problem with EIP component when I try to done my InOut
> Message Exchange. I configure a RemoteSMClient object in my application
> which send am IO message to a EIP configure to trace the message and send
> to
> another component the message. Everything ges well, except when I try to
> send the DONE status form my remoteSMClient. The remote SM embedded with
> my
> RemoteSMClient send me the error one done action :
>
> 3580558 [Thread-11] ERROR org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow
> null - Caught an exception routing ExchangePacket
> Throwable : javax.jbi.messaging.MessagingException: No component named
> ofsmlTester - Couldn't route MessageExchange...
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> AbstractFlow.java:180)
>
> I trace a bit more the context to see difference between send action and
> done action. I add the line:
> log.debug("Called Flow doRouting For " + id.getName() + " Destination " +
> me.getDestinationId() + " role : " + me.getRole() + "Endpoint  " +
> me.getEndpoint() + "Source Id: " + me.getSourceId());
>
> Send: in AbstractFlow.doRouting method I have :
> Called Flow doRouting For ID:homework-4519-1147970921380-0:0 Destination
> [container=ServiceMix,name=myEip] role : ConsumerEndpoint
> ServiceEndpoint[service=tagAPIBC,endpoint=endpoint]Source Id:
> [container=ServiceMix,name=ID:homework-4519-1147970921380-0:0]
> and the lcc is not null.
>
> Done: in AbstractFlow.doRouting method I have :
> Called Flow doRouting For ofsmlTester Destination
> [container=ServiceMix,name=ofsmlTester] role : ProviderEndpoint
> ServiceEndpoint[service=ofsml,endpoint=ofsmlTester]Source Id:
> [container=ServiceMix,name=myEip]
> and the lcc object is null
>
> I suspect EIP to put a bad sourceId in the IOMex.
>
> If you have an idea, "Guillaume", you are welcome.
>
> Tomorrow, I will without the RemoteSMClient Object.
>
> Thanks,
> Phil
>
>
>
> --
> View this message in context:
> http://www.nabble.com/RemoteServiceMixClient---EIP-component---done-an-IOMEX-t1644809.html#a4455054
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet