You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by gigeril <ma...@knapp.com> on 2008/08/05 17:04:58 UTC
Drools BindingComponent get Stuck after sending 23 Messages???
Hi @ all.
I've following following setup of Servicemix:
TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
|____>HTTP BC -->
HTTP Server
If I connect (target Service) my own written TCP BC to the HTTP BC or the
TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
I get a problem if the drools engine get into the message chain. Then I only
can send 23 Messages (always 23!!) until my tcp client reports me a
connection timeout and the connectors get stuck. I can only press STRG+C in
the Servicemix Console Window to restart Servicemix and send 23 Messages.
This sending of this 23 Messages work fine. They take the way I defined in
my .drl where it depends on the message content if it is send to the tcp or
the http server. I also get the response back to the client.
This is the output when I press STRG+C. This whole stacktrace is printed out
23 times.
INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
droolsrouter-sa
INFO - ServiceUnitLifeCycle - Shutting down service unit:
droolsrouter-su
INFO - ServiceUnitLifeCycle - Shutting down service unit:
httpprovider-su
INFO - ServiceUnitLifeCycle - Shutting down service unit:
tcpconsumer-su
INFO - ServiceUnitLifeCycle - Shutting down service unit:
tcpprovider-su
INFO - JBIContainer - ServiceMix JBI Container
(ServiceMix) stopped
[Fatal Error] :1:89: Content is not allowed in trailing section.
ERROR - DroolsComponent - Error processing exchange InOut[
id: ID:10.22.20.113-11b93600c6f-4:0
status: Active
role: provider
service: {http://knapp.com/tcphttp}myRouter
endpoint: myRouter
in: <?xml version="1.0" encoding="UTF-8"?><message
type="http"><text>hallo</text></message>
out: Unable to display: org.xml.sax.SAXParseException: Content is not
allowed in trailing section.
]
org.drools.spi.ConsequenceException: javax.jbi.messaging.MessagingException:
java.lang.InterruptedException
at
org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
at
org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
at
org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.jbi.messaging.MessagingException:
java.lang.InterruptedException
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
at
org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
at
org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
at
org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
at
org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
at
org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
oker.java:20)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
... 16 more
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
... 23 more
ERROR - DroolsComponent - Error setting exchange status to
ERROR
java.lang.IllegalStateException: component is not owner when trying to set
error: org.drools.spi.ConsequenceException: j
avax.jbi.messaging.MessagingException: java.lang.InterruptedException
at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.drools.spi.ConsequenceException:
javax.jbi.messaging.MessagingException: java.lang.InterruptedException
at
org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
at
org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
at
org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
... 8 more
Caused by: javax.jbi.messaging.MessagingException:
java.lang.InterruptedException
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
at
org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
at
org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
at
org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
at
org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
at
org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
oker.java:20)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
... 16 more
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
... 23 more
So my rule.drl looks like:
package org.apache.servicemix.drools
import org.apache.servicemix.drools.model.Exchange;
global org.apache.servicemix.drools.model.JbiHelper jbi;
rule "tcphttp:http"
when
me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
eval( inmsg.xpath("/message/@type = \"http\""))
then
System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
end
rule "tcphttp:tcp"
when
me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
eval( inmsg.xpath("/message/@type = \"tcp\""));
then
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
end
My xbean.xml for the drools su:
<beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
xmlns:tcphttp="http://knapp.com/tcphttp"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<drools:endpoint service="tcphttp:myRouter"
endpoint="myRouter"
ruleBaseResource="classpath:rule.drl"
namespaceContext="#nsContext" />
<drools:namespace-context id="nsContext">
<drools:namespaces>
<drools:namespace
prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
</drools:namespaces>
</drools:namespace-context>
</beans>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18833113.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Oleg Atamanenko <da...@gmail.com>.
Hello all.
I found exactly the same problem.
But I have a little bit different flow of messages.
Since drools send sync messages (and it is correct) the caller thread starts
to wait. And if to use drools as message router(as I do) all messages are
routed using drools, and since messages are routed sync- the calling threads
are blocked until they get answer and it causes to use a lot of threads,
which end up very fast.
I don't know what to do, because I want to route a lot of messages (up to
several millions per 24 hours)
Also, I found if I have a small a mount of messages (i.e 1 message per
minute, then all works perfect and messages are processed) If I increase
amount of messages, then, after some value drools blocks (because of sync)
I looked in the drools component source, but it looks correct for me.
Best regards,
Oleg Atamanenko.
2008/8/5 gigeril <ma...@knapp.com>
>
> Hi @ all.
> I've following following setup of Servicemix:
>
>
> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
> |____>HTTP BC -->
> HTTP Server
>
> If I connect (target Service) my own written TCP BC to the HTTP BC or the
> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>
> I get a problem if the drools engine get into the message chain. Then I
> only
> can send 23 Messages (always 23!!) until my tcp client reports me a
> connection timeout and the connectors get stuck. I can only press STRG+C in
> the Servicemix Console Window to restart Servicemix and send 23 Messages.
> This sending of this 23 Messages work fine. They take the way I defined in
> my .drl where it depends on the message content if it is send to the tcp or
> the http server. I also get the response back to the client.
>
> This is the output when I press STRG+C. This whole stacktrace is printed
> out
> 23 times.
>
> INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
> droolsrouter-sa
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> droolsrouter-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> httpprovider-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> tcpconsumer-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> tcpprovider-su
> INFO - JBIContainer - ServiceMix JBI Container
> (ServiceMix) stopped
> [Fatal Error] :1:89: Content is not allowed in trailing section.
> ERROR - DroolsComponent - Error processing exchange InOut[
> id: ID:10.22.20.113-11b93600c6f-4:0
> status: Active
> role: provider
> service: {http://knapp.com/tcphttp}myRouter<http://knapp.com/tcphttp%7DmyRouter>
> endpoint: myRouter
> in: <?xml version="1.0" encoding="UTF-8"?><message
> type="http"><text>hallo</text></message>
> out: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in trailing section.
> ]
> org.drools.spi.ConsequenceException:
> javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
>
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
> )
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> at
>
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> at
>
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> at
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> at
>
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> at
>
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
>
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
>
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> at
>
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> at
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> at
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> at
>
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> at
>
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
> oker.java:20)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> ... 16 more
> Caused by: java.lang.InterruptedException
> at java.lang.Object.wait(Native Method)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> ... 23 more
> ERROR - DroolsComponent - Error setting exchange status to
> ERROR
> java.lang.IllegalStateException: component is not owner when trying to set
> error: org.drools.spi.ConsequenceException: j
> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
> at
>
> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
> at
>
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
>
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
>
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.drools.spi.ConsequenceException:
> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
> at
>
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
> )
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> at
>
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> at
>
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> at
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> at
>
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> at
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> ... 8 more
> Caused by: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> at
>
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> at
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> at
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> at
>
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> at
>
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
> oker.java:20)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> ... 16 more
> Caused by: java.lang.InterruptedException
> at java.lang.Object.wait(Native Method)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> at
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> ... 23 more
>
>
>
> So my rule.drl looks like:
>
> package org.apache.servicemix.drools
>
> import org.apache.servicemix.drools.model.Exchange;
>
> global org.apache.servicemix.drools.model.JbiHelper jbi;
>
>
> rule "tcphttp:http"
> when
> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
> );
> eval( inmsg.xpath("/message/@type = \"http\""))
> then
>
> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
> );
> end
>
> rule "tcphttp:tcp"
> when
> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
> );
> eval( inmsg.xpath("/message/@type = \"tcp\""));
> then
>
> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
> );
> end
>
>
>
>
> My xbean.xml for the drools su:
>
> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
> xmlns:tcphttp="http://knapp.com/tcphttp"
> xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
> <drools:endpoint service="tcphttp:myRouter"
> endpoint="myRouter"
> ruleBaseResource="classpath:rule.drl"
> namespaceContext="#nsContext" />
>
>
> <drools:namespace-context id="nsContext">
> <drools:namespaces>
> <drools:namespace
> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
> </drools:namespaces>
> </drools:namespace-context>
>
> </beans>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18833113.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Lars Heinemann <la...@compart.net>.
In my opinion it is not important if using drools as router is a good or a bad
solution. Fact is if drools offers routing functionality, then it will be used.
Maybe not by Andrea, but for sure by enough other people.
Lars
Am Mittwoch 06 August 2008 11:40:52 schrieb Oleg Atamanenko:
> Hi, guys.
>
> I agree.
>
> As for my use case - I have several custom components which should be used
> in the one flow. The set of components is different between different
> customers and each customer have a little different flow between
> components. Drools looks very good for routing in this situation.
>
> Best regards,
> Oleg Atamanenko.
>
>
> 2008/8/6 Andrea Zoppello <zo...@tiscali.it>
>
> > Hi Lars,
> >
> > I've doubt that a customer that don't want to code java will manually
> > coding drools file :-)
> >
> > BTW i've this type of problems every day so i say how i've solved.
> >
> > I give customer i high level process designer, and let him to generate
> > service assembly.
> > If he wants to chnage rules, he can simply change visually the process
> > and regenerate code.
> >
> > In our platform we've code generators where the user design routing rules
> > visually and we get the drools file automatically generated, the only
> > thing you need to provide are xpath rule.
> >
> > Have you take a look at the spagic platform???
> >
> >
> > Andrea
> >
> > Lars Heinemann ha scritto:
> >> Andrea,
> >>
> >> look at following situation:
> >> You got a installation of your smx stuff at customers site. The customer
> >> wants to influence the routing mechanism. He is not aware of Java and
> >> also has no time and manpower to code a bean SU nor to code anything
> >> with smx. So how can this customer now solve this? Everytime calling a
> >> consulting company doing coding etc?
> >> The drools file is in the data folder of smx. He can easily go there and
> >> adapt the rules and targets without the need of recompiling/redeployment
> >> etc.
> >>
> >> And btw. if a customer wants the router to be done with drools, you
> >> can't tell him to use servicemix-bean instead ;)
> >>
> >> Regards
> >> Lars
> >>
> >> Am Mittwoch 06 August 2008 11:09:26 schrieb Andrea Zoppello:
> >>> Hi Lars,
> >>>
> >>> What you're saing it's right nothing prevent to route an InOut
> >>> Exchange, but in my opinion in that case you have other better choices
> >>> than drools component.
> >>>
> >>> I'm doing something similar processing, as you described and i've done
> >>> better for example with servicemix-bean than that drools.
> >>>
> >>> In my opininion the original idea of the JbiHelper was to provide an
> >>> helper class, that could help user to route messages not to write
> >>> complex MEP exchange inside the route method, for this reason for me
> >>> make sense to have a class with two methods where:
> >>>
> >>> 1) route is used to route InOnly or RobustInOnly exchange
> >>>
> >>> 2) answer instead if you want to answer on the out message when an
> >>> InOut Exchage.
> >>>
> >>>
> >>> Andrea
> >>>
> >>> Lars Heinemann ha scritto:
> >>>> Andrea,
> >>>>
> >>>> just some thoughts....
> >>>>
> >>>> Am Mittwoch 06 August 2008 10:48:02 schrieb Andrea Zoppello:
> >>>>> Hi Gert,
> >>>>>
> >>>>> The route method in my opinion is to handle inonly or robust inonly
> >>>>> exchange, if you want to answer you could use the answer method.
> >>>>
> >>>> --> what prevents a user to not route InOut exchanges and why doesn't
> >>>> it makes sense? If you use the drools as a simple router this makes
> >>>> imho sense. You are right if all your processing logic is done in your
> >>>> drools script, then you can just process it and send the answer.
> >>>>
> >>>> Regards
> >>>> Lars
> >>>>
> >>>>> In my opinion you must choose what you want to do when you write
> >>>>> drools file.
> >>>>>
> >>>>> If you need to forward ( creating another exhange ) an InOnly
> >>>>> exchange use helper.route instead you need to use helper.answer.
> >>>>>
> >>>>> This should cover all the case.
> >>>>>
> >>>>> Andrea
> >>>>>
> >>>>> Gert Vanthienen ha scritto:
> >>>>>> Andrea,
> >>>>>>
> >>>>>> Actually, I was just looking at applying that. If the code in your
> >>>>>> last comment goes into the routeTo method, isn't this a step back
> >>>>>> from where we were? It uses send() instead of sendSync(), but I no
> >>>>>> longer see any possibility of handling an InOut or RobustInOnly with
> >>>>>> a Fault message, or am I missing something there?
> >>>>>>
> >>>>>> Regards,
> >>>>>>
> >>>>>> Gert
> >>>>>>
> >>>>>> Andrea Zoppello wrote:
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> I had the same problem, take a look to mine last comment on
> >>>>>>> https://issues.apache.org/activemq/browse/SM-1248
> >>>>>>>
> >>>>>>> Andrea
> >>>>>>>
> >>>>>>> gigeril ha scritto:
> >>>>>>>> Hi @ all.
> >>>>>>>> I've following following setup of Servicemix:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP
> >>>>>>>> Server
> >>>>>>>>
> >>>>>>>> |____>HTTP
> >>>>>>>>
> >>>>>>>> BC -->
> >>>>>>>> HTTP Server
> >>>>>>>>
> >>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
> >>>>>>>> or the
> >>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
> >>>>>>>> I get a problem if the drools engine get into the message chain.
> >>>>>>>> Then I only
> >>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me
> >>>>>>>> a connection timeout and the connectors get stuck. I can only
> >>>>>>>> press STRG+C in
> >>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
> >>>>>>>> Messages.
> >>>>>>>> This sending of this 23 Messages work fine. They take the way I
> >>>>>>>> defined in
> >>>>>>>> my .drl where it depends on the message content if it is send to
> >>>>>>>> the tcp or
> >>>>>>>> the http server. I also get the response back to the client.
> >>>>>>>>
> >>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
> >>>>>>>> printed out
> >>>>>>>> 23 times.
> >>>>>>>>
> >>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
> >>>>>>>> assembly:
> >>>>>>>> droolsrouter-sa
> >>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
> >>>>>>>> unit: droolsrouter-su
> >>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
> >>>>>>>> unit: httpprovider-su
> >>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
> >>>>>>>> unit: tcpconsumer-su
> >>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
> >>>>>>>> unit: tcpprovider-su
> >>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
> >>>>>>>> (ServiceMix) stopped
> >>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
> >>>>>>>> ERROR - DroolsComponent - Error processing exchange
> >>>>>>>> InOut[
> >>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
> >>>>>>>> status: Active
> >>>>>>>> role: provider
> >>>>>>>> service:
> >>>>>>>> {http://knapp.com/tcphttp}myRouter<http://knapp.com/tcphttp%7DmyRo
> >>>>>>>>uter> endpoint: myRouter
> >>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
> >>>>>>>> type="http"><text>hallo</text></message>
> >>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
> >>>>>>>> not allowed in trailing section.
> >>>>>>>> ]
> >>>>>>>> org.drools.spi.ConsequenceException:
> >>>>>>>> javax.jbi.messaging.MessagingException:
> >>>>>>>> java.lang.InterruptedException
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException
> >>>>>>>>(De fa ultConsequenceExceptionHandler.java:13
> >>>>>>>>
> >>>>>>>> )
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:
> >>>>>>>>558 ) at
> >>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:51
> >>>>>>>>8) at
> >>>>>>>>
> >>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorki
> >>>>>>>>ngM em ory.java:475)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorki
> >>>>>>>>ngM em ory.java:439)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.
> >>>>>>>>jav a: 183)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint
> >>>>>>>>.ja va
> >>>>>>>>
> >>>>>>>> :177)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBas
> >>>>>>>>eLi fe Cycle.java:597)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(As
> >>>>>>>>ync Ba seLifeCycle.java:548)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(
> >>>>>>>>Asy nc BaseLifeCycle.java:502)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchang
> >>>>>>>>e(S yn cLifeCycleWrapper.java:60)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInB
> >>>>>>>>oun d( DeliveryChannelImpl.java:610)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abstract
> >>>>>>>>Flo w. java:172)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlo
> >>>>>>>>w.j av a:168)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.
> >>>>>>>>jav a: 134)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolE
> >>>>>>>>xec ut or.java:885)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecu
> >>>>>>>>tor .j ava:907)
> >>>>>>>>
> >>>>>>>> at java.lang.Thread.run(Thread.java:619)
> >>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
> >>>>>>>> java.lang.InterruptedException
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(D
> >>>>>>>>eli ve ryChannelImpl.java:498)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(D
> >>>>>>>>eli ve ryChannelImpl.java:442)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endp
> >>>>>>>>oin tD eliveryChannel.java:102)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.jav
> >>>>>>>>a:1 51 )
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:
> >>>>>>>>109 ) at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_
> >>>>>>>>tcp ht tp_http_0.java:14)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker
> >>>>>>>>.ev al uate(Rule_tcphttp_http_0ConsequenceInv
> >>>>>>>>
> >>>>>>>> oker.java:20)
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:
> >>>>>>>>554 ) ... 16 more
> >>>>>>>> Caused by: java.lang.InterruptedException
> >>>>>>>> at java.lang.Object.wait(Native Method)
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExc
> >>>>>>>>han ge (DeliveryChannelImpl.java:699)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(D
> >>>>>>>>eli ve ryChannelImpl.java:472)
> >>>>>>>>
> >>>>>>>> ... 23 more
> >>>>>>>> ERROR - DroolsComponent - Error setting exchange
> >>>>>>>> status to
> >>>>>>>> ERROR
> >>>>>>>> java.lang.IllegalStateException: component is not owner when
> >>>>>>>> trying to set
> >>>>>>>> error: org.drools.spi.ConsequenceException: j
> >>>>>>>> avax.jbi.messaging.MessagingException:
> >>>>>>>> java.lang.InterruptedException
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(M
> >>>>>>>>ess ag eExchangeImpl.java:264)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(
> >>>>>>>>Asy nc BaseLifeCycle.java:516)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchang
> >>>>>>>>e(S yn cLifeCycleWrapper.java:60)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInB
> >>>>>>>>oun d( DeliveryChannelImpl.java:610)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abstract
> >>>>>>>>Flo w. java:172)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlo
> >>>>>>>>w.j av a:168)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.
> >>>>>>>>jav a: 134)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolE
> >>>>>>>>xec ut or.java:885)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecu
> >>>>>>>>tor .j ava:907)
> >>>>>>>>
> >>>>>>>> at java.lang.Thread.run(Thread.java:619)
> >>>>>>>> Caused by: org.drools.spi.ConsequenceException:
> >>>>>>>> javax.jbi.messaging.MessagingException:
> >>>>>>>> java.lang.InterruptedException at
> >>>>>>>>
> >>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException
> >>>>>>>>(De fa ultConsequenceExceptionHandler.java:13
> >>>>>>>>
> >>>>>>>> )
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:
> >>>>>>>>558 ) at
> >>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:51
> >>>>>>>>8) at
> >>>>>>>>
> >>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorki
> >>>>>>>>ngM em ory.java:475)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorki
> >>>>>>>>ngM em ory.java:439)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.
> >>>>>>>>jav a: 183)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint
> >>>>>>>>.ja va
> >>>>>>>>
> >>>>>>>> :177)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBas
> >>>>>>>>eLi fe Cycle.java:597)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(As
> >>>>>>>>ync Ba seLifeCycle.java:548)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(
> >>>>>>>>Asy nc BaseLifeCycle.java:502)
> >>>>>>>>
> >>>>>>>> ... 8 more
> >>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
> >>>>>>>> java.lang.InterruptedException
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(D
> >>>>>>>>eli ve ryChannelImpl.java:498)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(D
> >>>>>>>>eli ve ryChannelImpl.java:442)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endp
> >>>>>>>>oin tD eliveryChannel.java:102)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.jav
> >>>>>>>>a:1 51 )
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:
> >>>>>>>>109 ) at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_
> >>>>>>>>tcp ht tp_http_0.java:14)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker
> >>>>>>>>.ev al uate(Rule_tcphttp_http_0ConsequenceInv
> >>>>>>>>
> >>>>>>>> oker.java:20)
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:
> >>>>>>>>554 ) ... 16 more
> >>>>>>>> Caused by: java.lang.InterruptedException
> >>>>>>>> at java.lang.Object.wait(Native Method)
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExc
> >>>>>>>>han ge (DeliveryChannelImpl.java:699)
> >>>>>>>>
> >>>>>>>> at
> >>>>>>>>
> >>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(D
> >>>>>>>>eli ve ryChannelImpl.java:472)
> >>>>>>>>
> >>>>>>>> ... 23 more
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> So my rule.drl looks like:
> >>>>>>>>
> >>>>>>>> package org.apache.servicemix.drools
> >>>>>>>>
> >>>>>>>> import org.apache.servicemix.drools.model.Exchange;
> >>>>>>>>
> >>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> rule "tcphttp:http"
> >>>>>>>> when
> >>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
> >>>>>>>> null ); eval( inmsg.xpath("/message/@type = \"http\""))
> >>>>>>>> then
> >>>>>>>>
> >>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!
> >>>>>>>>!! ");
> >>>>>>>> jbi.route(
> >>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider" ); end
> >>>>>>>>
> >>>>>>>> rule "tcphttp:tcp"
> >>>>>>>> when
> >>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
> >>>>>>>> null ); eval( inmsg.xpath("/message/@type = \"tcp\""));
> >>>>>>>> then
> >>>>>>>>
> >>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
> >>>>>>>> "); jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
> >>>>>>>> end
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> My xbean.xml for the drools su:
> >>>>>>>>
> >>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
> >>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
> >>>>>>>> xmlns="http://www.springframework.org/schema/beans"
> >>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
> >>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
> >>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
> >>>>>>>> http://www.springframework.org/schema/beans
> >>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
> >>>>>>>>
> >>>>>>>> <drools:endpoint service="tcphttp:myRouter"
> >>>>>>>> endpoint="myRouter"
> >>>>>>>> ruleBaseResource="classpath:rule.drl"
> >>>>>>>> namespaceContext="#nsContext" />
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> <drools:namespace-context id="nsContext">
> >>>>>>>> <drools:namespaces>
> >>>>>>>> <drools:namespace
> >>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
> >>>>>>>> </drools:namespaces>
> >>>>>>>> </drools:namespace-context>
> >>>>>>>>
> >>>>>>>> </beans>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Oleg Atamanenko <da...@gmail.com>.
Hi, guys.
I agree.
As for my use case - I have several custom components which should be used
in the one flow. The set of components is different between different
customers and each customer have a little different flow between components.
Drools looks very good for routing in this situation.
Best regards,
Oleg Atamanenko.
2008/8/6 Andrea Zoppello <zo...@tiscali.it>
> Hi Lars,
>
> I've doubt that a customer that don't want to code java will manually
> coding drools file :-)
>
> BTW i've this type of problems every day so i say how i've solved.
>
> I give customer i high level process designer, and let him to generate
> service assembly.
> If he wants to chnage rules, he can simply change visually the process and
> regenerate code.
>
> In our platform we've code generators where the user design routing rules
> visually and we get the drools file automatically generated, the only thing
> you need to provide are xpath rule.
>
> Have you take a look at the spagic platform???
>
>
> Andrea
>
>
>
> Lars Heinemann ha scritto:
>
>> Andrea,
>>
>> look at following situation:
>> You got a installation of your smx stuff at customers site. The customer
>> wants to influence the routing mechanism. He is not aware of Java and also
>> has no time and manpower to code a bean SU nor to code anything with smx.
>> So how can this customer now solve this? Everytime calling a consulting
>> company doing coding etc?
>> The drools file is in the data folder of smx. He can easily go there and
>> adapt the rules and targets without the need of recompiling/redeployment
>> etc.
>>
>> And btw. if a customer wants the router to be done with drools, you can't
>> tell him to use servicemix-bean instead ;)
>>
>> Regards
>> Lars
>>
>>
>>
>> Am Mittwoch 06 August 2008 11:09:26 schrieb Andrea Zoppello:
>>
>>
>>> Hi Lars,
>>>
>>> What you're saing it's right nothing prevent to route an InOut Exchange,
>>> but in my opinion in that case you have other better choices than drools
>>> component.
>>>
>>> I'm doing something similar processing, as you described and i've done
>>> better for example with servicemix-bean than that drools.
>>>
>>> In my opininion the original idea of the JbiHelper was to provide an
>>> helper class, that could help user to route messages not to write
>>> complex MEP exchange inside the route method, for this reason for me
>>> make sense to have a class with two methods where:
>>>
>>> 1) route is used to route InOnly or RobustInOnly exchange
>>>
>>> 2) answer instead if you want to answer on the out message when an InOut
>>> Exchage.
>>>
>>>
>>> Andrea
>>>
>>> Lars Heinemann ha scritto:
>>>
>>>
>>>> Andrea,
>>>>
>>>> just some thoughts....
>>>>
>>>> Am Mittwoch 06 August 2008 10:48:02 schrieb Andrea Zoppello:
>>>>
>>>>
>>>>> Hi Gert,
>>>>>
>>>>> The route method in my opinion is to handle inonly or robust inonly
>>>>> exchange, if you want to answer you could use the answer method.
>>>>>
>>>>>
>>>> --> what prevents a user to not route InOut exchanges and why doesn't it
>>>> makes sense? If you use the drools as a simple router this makes imho
>>>> sense. You are right if all your processing logic is done in your drools
>>>> script, then you can just process it and send the answer.
>>>>
>>>> Regards
>>>> Lars
>>>>
>>>>
>>>>
>>>>> In my opinion you must choose what you want to do when you write drools
>>>>> file.
>>>>>
>>>>> If you need to forward ( creating another exhange ) an InOnly exchange
>>>>> use helper.route instead you need to use helper.answer.
>>>>>
>>>>> This should cover all the case.
>>>>>
>>>>> Andrea
>>>>>
>>>>> Gert Vanthienen ha scritto:
>>>>>
>>>>>
>>>>>> Andrea,
>>>>>>
>>>>>> Actually, I was just looking at applying that. If the code in your
>>>>>> last comment goes into the routeTo method, isn't this a step back from
>>>>>> where we were? It uses send() instead of sendSync(), but I no longer
>>>>>> see any possibility of handling an InOut or RobustInOnly with a Fault
>>>>>> message, or am I missing something there?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert
>>>>>>
>>>>>> Andrea Zoppello wrote:
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>
>>>>>>> Andrea
>>>>>>>
>>>>>>> gigeril ha scritto:
>>>>>>>
>>>>>>>
>>>>>>>> Hi @ all.
>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>
>>>>>>>>
>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>>>
>>>>>>>> |____>HTTP
>>>>>>>>
>>>>>>>> BC -->
>>>>>>>> HTTP Server
>>>>>>>>
>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>>>>> or the
>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>>> Then I only
>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>>> STRG+C in
>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>> Messages.
>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>> defined in
>>>>>>>> my .drl where it depends on the message content if it is send to the
>>>>>>>> tcp or
>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>
>>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>>> printed out
>>>>>>>> 23 times.
>>>>>>>>
>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>> assembly:
>>>>>>>> droolsrouter-sa
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>>> droolsrouter-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>>> httpprovider-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>>> tcpconsumer-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>>> tcpprovider-su
>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>> (ServiceMix) stopped
>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>>> InOut[
>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>> status: Active
>>>>>>>> role: provider
>>>>>>>> service: {http://knapp.com/tcphttp}myRouter<http://knapp.com/tcphttp%7DmyRouter>
>>>>>>>> endpoint: myRouter
>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>>> not allowed in trailing section.
>>>>>>>> ]
>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(De
>>>>>>>> fa ultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558
>>>>>>>> ) at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>>> em ory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>>> em ory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.jav
>>>>>>>> a: 183)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.ja
>>>>>>>> va
>>>>>>>>
>>>>>>>> :177)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
>>>>>>>> fe Cycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
>>>>>>>> Ba seLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
>>>>>>>> nc BaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
>>>>>>>> yn cLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>>>>>>>> d( DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>>>>>>>> w. java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>>>>>>>> av a:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>>>>>>>> a: 134)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
>>>>>>>> ut or.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
>>>>>>>> .j ava:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>>> ve ryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>>> ve ryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endpoin
>>>>>>>> tD eliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:1
>>>>>>>> 51 )
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109
>>>>>>>> ) at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcp
>>>>>>>> ht tp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.ev
>>>>>>>> al uate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554
>>>>>>>> ) ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchan
>>>>>>>> ge (DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>>> ve ryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>> status to
>>>>>>>> ERROR
>>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>>> to set
>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(Mess
>>>>>>>> ag eExchangeImpl.java:264)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
>>>>>>>> nc BaseLifeCycle.java:516)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
>>>>>>>> yn cLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>>>>>>>> d( DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>>>>>>>> w. java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>>>>>>>> av a:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>>>>>>>> a: 134)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
>>>>>>>> ut or.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
>>>>>>>> .j ava:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException at
>>>>>>>>
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(De
>>>>>>>> fa ultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558
>>>>>>>> ) at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>>> em ory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>>> em ory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.jav
>>>>>>>> a: 183)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.ja
>>>>>>>> va
>>>>>>>>
>>>>>>>> :177)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
>>>>>>>> fe Cycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
>>>>>>>> Ba seLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
>>>>>>>> nc BaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> ... 8 more
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>>> ve ryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>>> ve ryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endpoin
>>>>>>>> tD eliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:1
>>>>>>>> 51 )
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109
>>>>>>>> ) at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcp
>>>>>>>> ht tp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.ev
>>>>>>>> al uate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554
>>>>>>>> ) ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchan
>>>>>>>> ge (DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>>> ve ryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> So my rule.drl looks like:
>>>>>>>>
>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>
>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>
>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>
>>>>>>>>
>>>>>>>> rule "tcphttp:http"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>>> ); eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>>> ); end
>>>>>>>>
>>>>>>>> rule "tcphttp:tcp"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>>> ); eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>> "); jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>>>>> end
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>
>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>
>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>> endpoint="myRouter"
>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>
>>>>>>>>
>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>> <drools:namespaces>
>>>>>>>> <drools:namespace
>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>> </drools:namespaces>
>>>>>>>> </drools:namespace-context>
>>>>>>>>
>>>>>>>> </beans>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Andrea Zoppello <zo...@tiscali.it>.
Hi Lars,
I've doubt that a customer that don't want to code java will manually
coding drools file :-)
BTW i've this type of problems every day so i say how i've solved.
I give customer i high level process designer, and let him to generate
service assembly.
If he wants to chnage rules, he can simply change visually the process
and regenerate code.
In our platform we've code generators where the user design routing
rules visually and we get the drools file automatically generated, the
only thing you need to provide are xpath rule.
Have you take a look at the spagic platform???
Andrea
Lars Heinemann ha scritto:
> Andrea,
>
> look at following situation:
> You got a installation of your smx stuff at customers site. The customer wants
> to influence the routing mechanism. He is not aware of Java and also has no
> time and manpower to code a bean SU nor to code anything with smx.
> So how can this customer now solve this? Everytime calling a consulting
> company doing coding etc?
> The drools file is in the data folder of smx. He can easily go there and adapt
> the rules and targets without the need of recompiling/redeployment etc.
>
> And btw. if a customer wants the router to be done with drools, you can't tell
> him to use servicemix-bean instead ;)
>
> Regards
> Lars
>
>
>
> Am Mittwoch 06 August 2008 11:09:26 schrieb Andrea Zoppello:
>
>> Hi Lars,
>>
>> What you're saing it's right nothing prevent to route an InOut Exchange,
>> but in my opinion in that case you have other better choices than drools
>> component.
>>
>> I'm doing something similar processing, as you described and i've done
>> better for example with servicemix-bean than that drools.
>>
>> In my opininion the original idea of the JbiHelper was to provide an
>> helper class, that could help user to route messages not to write
>> complex MEP exchange inside the route method, for this reason for me
>> make sense to have a class with two methods where:
>>
>> 1) route is used to route InOnly or RobustInOnly exchange
>>
>> 2) answer instead if you want to answer on the out message when an InOut
>> Exchage.
>>
>>
>> Andrea
>>
>> Lars Heinemann ha scritto:
>>
>>> Andrea,
>>>
>>> just some thoughts....
>>>
>>> Am Mittwoch 06 August 2008 10:48:02 schrieb Andrea Zoppello:
>>>
>>>> Hi Gert,
>>>>
>>>> The route method in my opinion is to handle inonly or robust inonly
>>>> exchange, if you want to answer you could use the answer method.
>>>>
>>> --> what prevents a user to not route InOut exchanges and why doesn't it
>>> makes sense? If you use the drools as a simple router this makes imho
>>> sense. You are right if all your processing logic is done in your drools
>>> script, then you can just process it and send the answer.
>>>
>>> Regards
>>> Lars
>>>
>>>
>>>> In my opinion you must choose what you want to do when you write drools
>>>> file.
>>>>
>>>> If you need to forward ( creating another exhange ) an InOnly exchange
>>>> use helper.route instead you need to use helper.answer.
>>>>
>>>> This should cover all the case.
>>>>
>>>> Andrea
>>>>
>>>> Gert Vanthienen ha scritto:
>>>>
>>>>> Andrea,
>>>>>
>>>>> Actually, I was just looking at applying that. If the code in your
>>>>> last comment goes into the routeTo method, isn't this a step back from
>>>>> where we were? It uses send() instead of sendSync(), but I no longer
>>>>> see any possibility of handling an InOut or RobustInOnly with a Fault
>>>>> message, or am I missing something there?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> Andrea Zoppello wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I had the same problem, take a look to mine last comment on
>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>
>>>>>> Andrea
>>>>>>
>>>>>> gigeril ha scritto:
>>>>>>
>>>>>>> Hi @ all.
>>>>>>> I've following following setup of Servicemix:
>>>>>>>
>>>>>>>
>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>>
>>>>>>> |____>HTTP
>>>>>>>
>>>>>>> BC -->
>>>>>>> HTTP Server
>>>>>>>
>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>>>> or the
>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>> Then I only
>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>> STRG+C in
>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>> Messages.
>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>> defined in
>>>>>>> my .drl where it depends on the message content if it is send to the
>>>>>>> tcp or
>>>>>>> the http server. I also get the response back to the client.
>>>>>>>
>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>> printed out
>>>>>>> 23 times.
>>>>>>>
>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>> assembly:
>>>>>>> droolsrouter-sa
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> droolsrouter-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> httpprovider-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpconsumer-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpprovider-su
>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>> (ServiceMix) stopped
>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>> InOut[
>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>> status: Active
>>>>>>> role: provider
>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>> endpoint: myRouter
>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>> type="http"><text>hallo</text></message>
>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>> not allowed in trailing section.
>>>>>>> ]
>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(De
>>>>>>> fa ultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558
>>>>>>> ) at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>> em ory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>> em ory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.jav
>>>>>>> a: 183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.ja
>>>>>>> va
>>>>>>>
>>>>>>> :177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
>>>>>>> fe Cycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
>>>>>>> Ba seLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
>>>>>>> nc BaseLifeCycle.java:502)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
>>>>>>> yn cLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>>>>>>> d( DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>>>>>>> w. java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>>>>>>> av a:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>>>>>>> a: 134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
>>>>>>> ut or.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
>>>>>>> .j ava:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>> ve ryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>> ve ryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endpoin
>>>>>>> tD eliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:1
>>>>>>> 51 )
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109
>>>>>>> ) at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcp
>>>>>>> ht tp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.ev
>>>>>>> al uate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554
>>>>>>> ) ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchan
>>>>>>> ge (DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>> ve ryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>> status to
>>>>>>> ERROR
>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>> to set
>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(Mess
>>>>>>> ag eExchangeImpl.java:264)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
>>>>>>> nc BaseLifeCycle.java:516)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
>>>>>>> yn cLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>>>>>>> d( DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>>>>>>> w. java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>>>>>>> av a:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>>>>>>> a: 134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
>>>>>>> ut or.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
>>>>>>> .j ava:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(De
>>>>>>> fa ultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558
>>>>>>> ) at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>> em ory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
>>>>>>> em ory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.jav
>>>>>>> a: 183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.ja
>>>>>>> va
>>>>>>>
>>>>>>> :177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
>>>>>>> fe Cycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
>>>>>>> Ba seLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
>>>>>>> nc BaseLifeCycle.java:502)
>>>>>>>
>>>>>>> ... 8 more
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>> ve ryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>> ve ryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endpoin
>>>>>>> tD eliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:1
>>>>>>> 51 )
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109
>>>>>>> ) at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcp
>>>>>>> ht tp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.ev
>>>>>>> al uate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554
>>>>>>> ) ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchan
>>>>>>> ge (DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
>>>>>>> ve ryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So my rule.drl looks like:
>>>>>>>
>>>>>>> package org.apache.servicemix.drools
>>>>>>>
>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>
>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>
>>>>>>>
>>>>>>> rule "tcphttp:http"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> ); eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>> ); end
>>>>>>>
>>>>>>> rule "tcphttp:tcp"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> ); eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>> "); jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>>>> end
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> My xbean.xml for the drools su:
>>>>>>>
>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>> http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>
>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>> endpoint="myRouter"
>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>> namespaceContext="#nsContext" />
>>>>>>>
>>>>>>>
>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>> <drools:namespaces>
>>>>>>> <drools:namespace
>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>> </drools:namespaces>
>>>>>>> </drools:namespace-context>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Lars Heinemann <la...@compart.net>.
Andrea,
look at following situation:
You got a installation of your smx stuff at customers site. The customer wants
to influence the routing mechanism. He is not aware of Java and also has no
time and manpower to code a bean SU nor to code anything with smx.
So how can this customer now solve this? Everytime calling a consulting
company doing coding etc?
The drools file is in the data folder of smx. He can easily go there and adapt
the rules and targets without the need of recompiling/redeployment etc.
And btw. if a customer wants the router to be done with drools, you can't tell
him to use servicemix-bean instead ;)
Regards
Lars
Am Mittwoch 06 August 2008 11:09:26 schrieb Andrea Zoppello:
> Hi Lars,
>
> What you're saing it's right nothing prevent to route an InOut Exchange,
> but in my opinion in that case you have other better choices than drools
> component.
>
> I'm doing something similar processing, as you described and i've done
> better for example with servicemix-bean than that drools.
>
> In my opininion the original idea of the JbiHelper was to provide an
> helper class, that could help user to route messages not to write
> complex MEP exchange inside the route method, for this reason for me
> make sense to have a class with two methods where:
>
> 1) route is used to route InOnly or RobustInOnly exchange
>
> 2) answer instead if you want to answer on the out message when an InOut
> Exchage.
>
>
> Andrea
>
> Lars Heinemann ha scritto:
> > Andrea,
> >
> > just some thoughts....
> >
> > Am Mittwoch 06 August 2008 10:48:02 schrieb Andrea Zoppello:
> >> Hi Gert,
> >>
> >> The route method in my opinion is to handle inonly or robust inonly
> >> exchange, if you want to answer you could use the answer method.
> >
> > --> what prevents a user to not route InOut exchanges and why doesn't it
> > makes sense? If you use the drools as a simple router this makes imho
> > sense. You are right if all your processing logic is done in your drools
> > script, then you can just process it and send the answer.
> >
> > Regards
> > Lars
> >
> >> In my opinion you must choose what you want to do when you write drools
> >> file.
> >>
> >> If you need to forward ( creating another exhange ) an InOnly exchange
> >> use helper.route instead you need to use helper.answer.
> >>
> >> This should cover all the case.
> >>
> >> Andrea
> >>
> >> Gert Vanthienen ha scritto:
> >>> Andrea,
> >>>
> >>> Actually, I was just looking at applying that. If the code in your
> >>> last comment goes into the routeTo method, isn't this a step back from
> >>> where we were? It uses send() instead of sendSync(), but I no longer
> >>> see any possibility of handling an InOut or RobustInOnly with a Fault
> >>> message, or am I missing something there?
> >>>
> >>> Regards,
> >>>
> >>> Gert
> >>>
> >>> Andrea Zoppello wrote:
> >>>> Hi,
> >>>>
> >>>> I had the same problem, take a look to mine last comment on
> >>>> https://issues.apache.org/activemq/browse/SM-1248
> >>>>
> >>>> Andrea
> >>>>
> >>>> gigeril ha scritto:
> >>>>> Hi @ all.
> >>>>> I've following following setup of Servicemix:
> >>>>>
> >>>>>
> >>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
> >>>>>
> >>>>> |____>HTTP
> >>>>>
> >>>>> BC -->
> >>>>> HTTP Server
> >>>>>
> >>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
> >>>>> or the
> >>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
> >>>>> I get a problem if the drools engine get into the message chain.
> >>>>> Then I only
> >>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
> >>>>> connection timeout and the connectors get stuck. I can only press
> >>>>> STRG+C in
> >>>>> the Servicemix Console Window to restart Servicemix and send 23
> >>>>> Messages.
> >>>>> This sending of this 23 Messages work fine. They take the way I
> >>>>> defined in
> >>>>> my .drl where it depends on the message content if it is send to the
> >>>>> tcp or
> >>>>> the http server. I also get the response back to the client.
> >>>>>
> >>>>> This is the output when I press STRG+C. This whole stacktrace is
> >>>>> printed out
> >>>>> 23 times.
> >>>>>
> >>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
> >>>>> assembly:
> >>>>> droolsrouter-sa
> >>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>>>> droolsrouter-su
> >>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>>>> httpprovider-su
> >>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>>>> tcpconsumer-su
> >>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>>>> tcpprovider-su
> >>>>> INFO - JBIContainer - ServiceMix JBI Container
> >>>>> (ServiceMix) stopped
> >>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
> >>>>> ERROR - DroolsComponent - Error processing exchange
> >>>>> InOut[
> >>>>> id: ID:10.22.20.113-11b93600c6f-4:0
> >>>>> status: Active
> >>>>> role: provider
> >>>>> service: {http://knapp.com/tcphttp}myRouter
> >>>>> endpoint: myRouter
> >>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
> >>>>> type="http"><text>hallo</text></message>
> >>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
> >>>>> not allowed in trailing section.
> >>>>> ]
> >>>>> org.drools.spi.ConsequenceException:
> >>>>> javax.jbi.messaging.MessagingException:
> >>>>> java.lang.InterruptedException
> >>>>> at
> >>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(De
> >>>>>fa ultConsequenceExceptionHandler.java:13
> >>>>>
> >>>>> )
> >>>>> at
> >>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558
> >>>>>) at
> >>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> >>>>> at
> >>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
> >>>>>em ory.java:475)
> >>>>>
> >>>>> at
> >>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
> >>>>>em ory.java:439)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.jav
> >>>>>a: 183)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.ja
> >>>>>va
> >>>>>
> >>>>> :177)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
> >>>>>fe Cycle.java:597)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
> >>>>>Ba seLifeCycle.java:548)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
> >>>>>nc BaseLifeCycle.java:502)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
> >>>>>yn cLifeCycleWrapper.java:60)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
> >>>>>d( DeliveryChannelImpl.java:610)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
> >>>>>w. java:172)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
> >>>>>av a:168)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
> >>>>>a: 134)
> >>>>>
> >>>>> at
> >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> >>>>>ut or.java:885)
> >>>>>
> >>>>> at
> >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> >>>>>.j ava:907)
> >>>>>
> >>>>> at java.lang.Thread.run(Thread.java:619)
> >>>>> Caused by: javax.jbi.messaging.MessagingException:
> >>>>> java.lang.InterruptedException
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
> >>>>>ve ryChannelImpl.java:498)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
> >>>>>ve ryChannelImpl.java:442)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endpoin
> >>>>>tD eliveryChannel.java:102)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:1
> >>>>>51 )
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109
> >>>>>) at
> >>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcp
> >>>>>ht tp_http_0.java:14)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.ev
> >>>>>al uate(Rule_tcphttp_http_0ConsequenceInv
> >>>>>
> >>>>> oker.java:20)
> >>>>> at
> >>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554
> >>>>>) ... 16 more
> >>>>> Caused by: java.lang.InterruptedException
> >>>>> at java.lang.Object.wait(Native Method)
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchan
> >>>>>ge (DeliveryChannelImpl.java:699)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
> >>>>>ve ryChannelImpl.java:472)
> >>>>>
> >>>>> ... 23 more
> >>>>> ERROR - DroolsComponent - Error setting exchange
> >>>>> status to
> >>>>> ERROR
> >>>>> java.lang.IllegalStateException: component is not owner when trying
> >>>>> to set
> >>>>> error: org.drools.spi.ConsequenceException: j
> >>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(Mess
> >>>>>ag eExchangeImpl.java:264)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
> >>>>>nc BaseLifeCycle.java:516)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(S
> >>>>>yn cLifeCycleWrapper.java:60)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
> >>>>>d( DeliveryChannelImpl.java:610)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
> >>>>>w. java:172)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
> >>>>>av a:168)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
> >>>>>a: 134)
> >>>>>
> >>>>> at
> >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> >>>>>ut or.java:885)
> >>>>>
> >>>>> at
> >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> >>>>>.j ava:907)
> >>>>>
> >>>>> at java.lang.Thread.run(Thread.java:619)
> >>>>> Caused by: org.drools.spi.ConsequenceException:
> >>>>> javax.jbi.messaging.MessagingException:
> >>>>> java.lang.InterruptedException at
> >>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(De
> >>>>>fa ultConsequenceExceptionHandler.java:13
> >>>>>
> >>>>> )
> >>>>> at
> >>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558
> >>>>>) at
> >>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> >>>>> at
> >>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
> >>>>>em ory.java:475)
> >>>>>
> >>>>> at
> >>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingM
> >>>>>em ory.java:439)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.jav
> >>>>>a: 183)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.ja
> >>>>>va
> >>>>>
> >>>>> :177)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
> >>>>>fe Cycle.java:597)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
> >>>>>Ba seLifeCycle.java:548)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Asy
> >>>>>nc BaseLifeCycle.java:502)
> >>>>>
> >>>>> ... 8 more
> >>>>> Caused by: javax.jbi.messaging.MessagingException:
> >>>>> java.lang.InterruptedException
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
> >>>>>ve ryChannelImpl.java:498)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
> >>>>>ve ryChannelImpl.java:442)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(Endpoin
> >>>>>tD eliveryChannel.java:102)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:1
> >>>>>51 )
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109
> >>>>>) at
> >>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcp
> >>>>>ht tp_http_0.java:14)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.ev
> >>>>>al uate(Rule_tcphttp_http_0ConsequenceInv
> >>>>>
> >>>>> oker.java:20)
> >>>>> at
> >>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554
> >>>>>) ... 16 more
> >>>>> Caused by: java.lang.InterruptedException
> >>>>> at java.lang.Object.wait(Native Method)
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchan
> >>>>>ge (DeliveryChannelImpl.java:699)
> >>>>>
> >>>>> at
> >>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli
> >>>>>ve ryChannelImpl.java:472)
> >>>>>
> >>>>> ... 23 more
> >>>>>
> >>>>>
> >>>>>
> >>>>> So my rule.drl looks like:
> >>>>>
> >>>>> package org.apache.servicemix.drools
> >>>>>
> >>>>> import org.apache.servicemix.drools.model.Exchange;
> >>>>>
> >>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
> >>>>>
> >>>>>
> >>>>> rule "tcphttp:http"
> >>>>> when
> >>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
> >>>>> ); eval( inmsg.xpath("/message/@type = \"http\""))
> >>>>> then
> >>>>>
> >>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
> >>>>> ");
> >>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
> >>>>> ); end
> >>>>>
> >>>>> rule "tcphttp:tcp"
> >>>>> when
> >>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
> >>>>> ); eval( inmsg.xpath("/message/@type = \"tcp\""));
> >>>>> then
> >>>>>
> >>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
> >>>>> "); jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
> >>>>> end
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> My xbean.xml for the drools su:
> >>>>>
> >>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
> >>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
> >>>>> xmlns="http://www.springframework.org/schema/beans"
> >>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
> >>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
> >>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
> >>>>> http://www.springframework.org/schema/beans
> >>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
> >>>>>
> >>>>> <drools:endpoint service="tcphttp:myRouter"
> >>>>> endpoint="myRouter"
> >>>>> ruleBaseResource="classpath:rule.drl"
> >>>>> namespaceContext="#nsContext" />
> >>>>>
> >>>>>
> >>>>> <drools:namespace-context id="nsContext">
> >>>>> <drools:namespaces>
> >>>>> <drools:namespace
> >>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
> >>>>> </drools:namespaces>
> >>>>> </drools:namespace-context>
> >>>>>
> >>>>> </beans>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Andrea Zoppello <zo...@tiscali.it>.
Hi Lars,
What you're saing it's right nothing prevent to route an InOut Exchange,
but in my opinion in that case you have other better choices than drools
component.
I'm doing something similar processing, as you described and i've done
better for example with servicemix-bean than that drools.
In my opininion the original idea of the JbiHelper was to provide an
helper class, that could help user to route messages not to write
complex MEP exchange inside the route method, for this reason for me
make sense to have a class with two methods where:
1) route is used to route InOnly or RobustInOnly exchange
2) answer instead if you want to answer on the out message when an InOut
Exchage.
Andrea
Lars Heinemann ha scritto:
> Andrea,
>
> just some thoughts....
>
> Am Mittwoch 06 August 2008 10:48:02 schrieb Andrea Zoppello:
>
>> Hi Gert,
>>
>> The route method in my opinion is to handle inonly or robust inonly
>> exchange, if you want to answer you could use the answer method.
>>
>
> --> what prevents a user to not route InOut exchanges and why doesn't it makes
> sense? If you use the drools as a simple router this makes imho sense.
> You are right if all your processing logic is done in your drools script, then
> you can just process it and send the answer.
>
> Regards
> Lars
>
>
>
>> In my opinion you must choose what you want to do when you write drools
>> file.
>>
>> If you need to forward ( creating another exhange ) an InOnly exchange
>> use helper.route instead you need to use helper.answer.
>>
>> This should cover all the case.
>>
>> Andrea
>>
>> Gert Vanthienen ha scritto:
>>
>>> Andrea,
>>>
>>> Actually, I was just looking at applying that. If the code in your
>>> last comment goes into the routeTo method, isn't this a step back from
>>> where we were? It uses send() instead of sendSync(), but I no longer
>>> see any possibility of handling an InOut or RobustInOnly with a Fault
>>> message, or am I missing something there?
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> Andrea Zoppello wrote:
>>>
>>>> Hi,
>>>>
>>>> I had the same problem, take a look to mine last comment on
>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>
>>>> Andrea
>>>>
>>>> gigeril ha scritto:
>>>>
>>>>> Hi @ all.
>>>>> I've following following setup of Servicemix:
>>>>>
>>>>>
>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>
>>>>> |____>HTTP
>>>>>
>>>>> BC -->
>>>>> HTTP Server
>>>>>
>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>> or the
>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>> I get a problem if the drools engine get into the message chain.
>>>>> Then I only
>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>> connection timeout and the connectors get stuck. I can only press
>>>>> STRG+C in
>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>> Messages.
>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>> defined in
>>>>> my .drl where it depends on the message content if it is send to the
>>>>> tcp or
>>>>> the http server. I also get the response back to the client.
>>>>>
>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>> printed out
>>>>> 23 times.
>>>>>
>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>> assembly:
>>>>> droolsrouter-sa
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> droolsrouter-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> httpprovider-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> tcpconsumer-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> tcpprovider-su
>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>> (ServiceMix) stopped
>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>> InOut[
>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>> status: Active
>>>>> role: provider
>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>> endpoint: myRouter
>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>> type="http"><text>hallo</text></message>
>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is not
>>>>> allowed in trailing section.
>>>>> ]
>>>>> org.drools.spi.ConsequenceException:
>>>>> javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(Defa
>>>>> ultConsequenceExceptionHandler.java:13
>>>>>
>>>>> )
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
>>>>> ory.java:475)
>>>>>
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
>>>>> ory.java:439)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:
>>>>> 183)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java
>>>>> :177)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLife
>>>>> Cycle.java:597)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBa
>>>>> seLifeCycle.java:548)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Async
>>>>> BaseLifeCycle.java:502)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(Syn
>>>>> cLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
>>>>> DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.
>>>>> java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.jav
>>>>> a:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:
>>>>> 134)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecut
>>>>> or.java:885)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j
>>>>> ava:907)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
>>>>> ryChannelImpl.java:498)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
>>>>> ryChannelImpl.java:442)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointD
>>>>> eliveryChannel.java:102)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151
>>>>> )
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcpht
>>>>> tp_http_0.java:14)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.eval
>>>>> uate(Rule_tcphttp_http_0ConsequenceInv
>>>>>
>>>>> oker.java:20)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>> ... 16 more
>>>>> Caused by: java.lang.InterruptedException
>>>>> at java.lang.Object.wait(Native Method)
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange
>>>>> (DeliveryChannelImpl.java:699)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
>>>>> ryChannelImpl.java:472)
>>>>>
>>>>> ... 23 more
>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>> status to
>>>>> ERROR
>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>> to set
>>>>> error: org.drools.spi.ConsequenceException: j
>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(Messag
>>>>> eExchangeImpl.java:264)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Async
>>>>> BaseLifeCycle.java:516)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(Syn
>>>>> cLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
>>>>> DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.
>>>>> java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.jav
>>>>> a:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:
>>>>> 134)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecut
>>>>> or.java:885)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j
>>>>> ava:907)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>> at
>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(Defa
>>>>> ultConsequenceExceptionHandler.java:13
>>>>>
>>>>> )
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
>>>>> ory.java:475)
>>>>>
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
>>>>> ory.java:439)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:
>>>>> 183)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java
>>>>> :177)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLife
>>>>> Cycle.java:597)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBa
>>>>> seLifeCycle.java:548)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Async
>>>>> BaseLifeCycle.java:502)
>>>>>
>>>>> ... 8 more
>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
>>>>> ryChannelImpl.java:498)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
>>>>> ryChannelImpl.java:442)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointD
>>>>> eliveryChannel.java:102)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151
>>>>> )
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcpht
>>>>> tp_http_0.java:14)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.eval
>>>>> uate(Rule_tcphttp_http_0ConsequenceInv
>>>>>
>>>>> oker.java:20)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>> ... 16 more
>>>>> Caused by: java.lang.InterruptedException
>>>>> at java.lang.Object.wait(Native Method)
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange
>>>>> (DeliveryChannelImpl.java:699)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
>>>>> ryChannelImpl.java:472)
>>>>>
>>>>> ... 23 more
>>>>>
>>>>>
>>>>>
>>>>> So my rule.drl looks like:
>>>>>
>>>>> package org.apache.servicemix.drools
>>>>>
>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>
>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>
>>>>>
>>>>> rule "tcphttp:http"
>>>>> when
>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>> then
>>>>>
>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>> ");
>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>>> end
>>>>>
>>>>> rule "tcphttp:tcp"
>>>>> when
>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>> then
>>>>>
>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>> end
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> My xbean.xml for the drools su:
>>>>>
>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>> http://www.springframework.org/schema/beans
>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>
>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>> endpoint="myRouter"
>>>>> ruleBaseResource="classpath:rule.drl"
>>>>> namespaceContext="#nsContext" />
>>>>>
>>>>>
>>>>> <drools:namespace-context id="nsContext">
>>>>> <drools:namespaces>
>>>>> <drools:namespace
>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>> </drools:namespaces>
>>>>> </drools:namespace-context>
>>>>>
>>>>> </beans>
>>>>>
>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Lars Heinemann <la...@compart.net>.
Andrea,
just some thoughts....
Am Mittwoch 06 August 2008 10:48:02 schrieb Andrea Zoppello:
> Hi Gert,
>
> The route method in my opinion is to handle inonly or robust inonly
> exchange, if you want to answer you could use the answer method.
--> what prevents a user to not route InOut exchanges and why doesn't it makes
sense? If you use the drools as a simple router this makes imho sense.
You are right if all your processing logic is done in your drools script, then
you can just process it and send the answer.
Regards
Lars
>
> In my opinion you must choose what you want to do when you write drools
> file.
>
> If you need to forward ( creating another exhange ) an InOnly exchange
> use helper.route instead you need to use helper.answer.
>
> This should cover all the case.
>
> Andrea
>
> Gert Vanthienen ha scritto:
> > Andrea,
> >
> > Actually, I was just looking at applying that. If the code in your
> > last comment goes into the routeTo method, isn't this a step back from
> > where we were? It uses send() instead of sendSync(), but I no longer
> > see any possibility of handling an InOut or RobustInOnly with a Fault
> > message, or am I missing something there?
> >
> > Regards,
> >
> > Gert
> >
> > Andrea Zoppello wrote:
> >> Hi,
> >>
> >> I had the same problem, take a look to mine last comment on
> >> https://issues.apache.org/activemq/browse/SM-1248
> >>
> >> Andrea
> >>
> >> gigeril ha scritto:
> >>> Hi @ all.
> >>> I've following following setup of Servicemix:
> >>>
> >>>
> >>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
> >>>
> >>> |____>HTTP
> >>>
> >>> BC -->
> >>> HTTP Server
> >>>
> >>> If I connect (target Service) my own written TCP BC to the HTTP BC
> >>> or the
> >>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
> >>> I get a problem if the drools engine get into the message chain.
> >>> Then I only
> >>> can send 23 Messages (always 23!!) until my tcp client reports me a
> >>> connection timeout and the connectors get stuck. I can only press
> >>> STRG+C in
> >>> the Servicemix Console Window to restart Servicemix and send 23
> >>> Messages.
> >>> This sending of this 23 Messages work fine. They take the way I
> >>> defined in
> >>> my .drl where it depends on the message content if it is send to the
> >>> tcp or
> >>> the http server. I also get the response back to the client.
> >>>
> >>> This is the output when I press STRG+C. This whole stacktrace is
> >>> printed out
> >>> 23 times.
> >>>
> >>> INFO - ServiceAssemblyLifeCycle - Shutting down service
> >>> assembly:
> >>> droolsrouter-sa
> >>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>> droolsrouter-su
> >>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>> httpprovider-su
> >>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>> tcpconsumer-su
> >>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> >>> tcpprovider-su
> >>> INFO - JBIContainer - ServiceMix JBI Container
> >>> (ServiceMix) stopped
> >>> [Fatal Error] :1:89: Content is not allowed in trailing section.
> >>> ERROR - DroolsComponent - Error processing exchange
> >>> InOut[
> >>> id: ID:10.22.20.113-11b93600c6f-4:0
> >>> status: Active
> >>> role: provider
> >>> service: {http://knapp.com/tcphttp}myRouter
> >>> endpoint: myRouter
> >>> in: <?xml version="1.0" encoding="UTF-8"?><message
> >>> type="http"><text>hallo</text></message>
> >>> out: Unable to display: org.xml.sax.SAXParseException: Content is not
> >>> allowed in trailing section.
> >>> ]
> >>> org.drools.spi.ConsequenceException:
> >>> javax.jbi.messaging.MessagingException:
> >>> java.lang.InterruptedException
> >>> at
> >>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(Defa
> >>>ultConsequenceExceptionHandler.java:13
> >>>
> >>> )
> >>> at
> >>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> >>> at
> >>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> >>> at
> >>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
> >>>ory.java:475)
> >>>
> >>> at
> >>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
> >>>ory.java:439)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:
> >>>183)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java
> >>>:177)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLife
> >>>Cycle.java:597)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBa
> >>>seLifeCycle.java:548)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Async
> >>>BaseLifeCycle.java:502)
> >>>
> >>> at
> >>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(Syn
> >>>cLifeCycleWrapper.java:60)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> >>>DeliveryChannelImpl.java:610)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.
> >>>java:172)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.jav
> >>>a:168)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:
> >>>134)
> >>>
> >>> at
> >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecut
> >>>or.java:885)
> >>>
> >>> at
> >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j
> >>>ava:907)
> >>>
> >>> at java.lang.Thread.run(Thread.java:619)
> >>> Caused by: javax.jbi.messaging.MessagingException:
> >>> java.lang.InterruptedException
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
> >>>ryChannelImpl.java:498)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
> >>>ryChannelImpl.java:442)
> >>>
> >>> at
> >>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointD
> >>>eliveryChannel.java:102)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151
> >>>)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> >>> at
> >>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcpht
> >>>tp_http_0.java:14)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.eval
> >>>uate(Rule_tcphttp_http_0ConsequenceInv
> >>>
> >>> oker.java:20)
> >>> at
> >>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> >>> ... 16 more
> >>> Caused by: java.lang.InterruptedException
> >>> at java.lang.Object.wait(Native Method)
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange
> >>>(DeliveryChannelImpl.java:699)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
> >>>ryChannelImpl.java:472)
> >>>
> >>> ... 23 more
> >>> ERROR - DroolsComponent - Error setting exchange
> >>> status to
> >>> ERROR
> >>> java.lang.IllegalStateException: component is not owner when trying
> >>> to set
> >>> error: org.drools.spi.ConsequenceException: j
> >>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
> >>> at
> >>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(Messag
> >>>eExchangeImpl.java:264)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Async
> >>>BaseLifeCycle.java:516)
> >>>
> >>> at
> >>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(Syn
> >>>cLifeCycleWrapper.java:60)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> >>>DeliveryChannelImpl.java:610)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.
> >>>java:172)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.jav
> >>>a:168)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:
> >>>134)
> >>>
> >>> at
> >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecut
> >>>or.java:885)
> >>>
> >>> at
> >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j
> >>>ava:907)
> >>>
> >>> at java.lang.Thread.run(Thread.java:619)
> >>> Caused by: org.drools.spi.ConsequenceException:
> >>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
> >>> at
> >>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(Defa
> >>>ultConsequenceExceptionHandler.java:13
> >>>
> >>> )
> >>> at
> >>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> >>> at
> >>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> >>> at
> >>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
> >>>ory.java:475)
> >>>
> >>> at
> >>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMem
> >>>ory.java:439)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:
> >>>183)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java
> >>>:177)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLife
> >>>Cycle.java:597)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBa
> >>>seLifeCycle.java:548)
> >>>
> >>> at
> >>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(Async
> >>>BaseLifeCycle.java:502)
> >>>
> >>> ... 8 more
> >>> Caused by: javax.jbi.messaging.MessagingException:
> >>> java.lang.InterruptedException
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
> >>>ryChannelImpl.java:498)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
> >>>ryChannelImpl.java:442)
> >>>
> >>> at
> >>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointD
> >>>eliveryChannel.java:102)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151
> >>>)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> >>> at
> >>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcpht
> >>>tp_http_0.java:14)
> >>>
> >>> at
> >>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.eval
> >>>uate(Rule_tcphttp_http_0ConsequenceInv
> >>>
> >>> oker.java:20)
> >>> at
> >>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> >>> ... 16 more
> >>> Caused by: java.lang.InterruptedException
> >>> at java.lang.Object.wait(Native Method)
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange
> >>>(DeliveryChannelImpl.java:699)
> >>>
> >>> at
> >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Delive
> >>>ryChannelImpl.java:472)
> >>>
> >>> ... 23 more
> >>>
> >>>
> >>>
> >>> So my rule.drl looks like:
> >>>
> >>> package org.apache.servicemix.drools
> >>>
> >>> import org.apache.servicemix.drools.model.Exchange;
> >>>
> >>> global org.apache.servicemix.drools.model.JbiHelper jbi;
> >>>
> >>>
> >>> rule "tcphttp:http"
> >>> when
> >>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
> >>> eval( inmsg.xpath("/message/@type = \"http\""))
> >>> then
> >>>
> >>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
> >>> ");
> >>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
> >>> end
> >>>
> >>> rule "tcphttp:tcp"
> >>> when
> >>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
> >>> eval( inmsg.xpath("/message/@type = \"tcp\""));
> >>> then
> >>>
> >>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
> >>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
> >>> end
> >>>
> >>>
> >>>
> >>>
> >>> My xbean.xml for the drools su:
> >>>
> >>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
> >>> xmlns:tcphttp="http://knapp.com/tcphttp"
> >>> xmlns="http://www.springframework.org/schema/beans"
> >>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
> >>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
> >>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
> >>> http://www.springframework.org/schema/beans
> >>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
> >>>
> >>> <drools:endpoint service="tcphttp:myRouter"
> >>> endpoint="myRouter"
> >>> ruleBaseResource="classpath:rule.drl"
> >>> namespaceContext="#nsContext" />
> >>>
> >>>
> >>> <drools:namespace-context id="nsContext">
> >>> <drools:namespaces>
> >>> <drools:namespace
> >>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
> >>> </drools:namespaces>
> >>> </drools:namespace-context>
> >>>
> >>> </beans>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
Andrea,
Let me try to work out a patch that handles InOut correctly in a
synchronous way for backward compatibility and uses asynchronous
messaging whenever possible. Could you give that a test run then?
Regards,
Gert
Andrea Zoppello wrote:
> Hi Gert,
>
> Waht about to make a route implementation so when an InOut Exchange
> arrives it will automatically call the answer method.
>
> BTW i cannot figure a usecase where you need to send an InOut exchange
> to a drools component and then rerouting this InOut exchange to
> another endpoint.
>
> As i said to Lars if you need this capabilities you could use other
> components, not drools.
>
> Andrea
>
> Andrea
> Gert Vanthienen ha scritto:
>> Andrea,
>>
>> Yeah, we should definitely get asynchronous support for Drools so we
>> need to get this done. If the route() method before was able to
>> handle InOut exchanges, we should make sure it still does to avoid
>> breaking people's existing code though -- how about replacing the
>> Exception being thrown at the end by a WARN log statement saying the
>> same thing but still handling the Exchange in a synchronous way as
>> before? This way, we still encourage people to start using answer().
>>
>> Gert
>>
>> Andrea Zoppello wrote:
>>> Ok Gert,
>>>
>>> Probably i miss to handle the error case, but except for this, i
>>> ensure i've stressed with load test the components and it works
>>> correcly, under heavvy load.
>>>
>>> My suggestion is to start from my code to handle error case, and to
>>> commit this.
>>>
>>> Do you agree is better to use helper.route for (InOnly / Robust
>>> InOnly ) and helper.answer for InOut??
>>>
>>> Andrea
>>> Gert Vanthienen ha scritto:
>>>> Andrea,
>>>>
>>>> And what if the InOnly MessageExchange you forwarded ends in
>>>> ERROR? The solution you proposed already answered the incoming
>>>> exchange with DONE by the time you figure that out. And I think
>>>> the same goes for RobustInOnly's fault message.
>>>>
>>>> Regards,
>>>>
>>>> Gert
>>>>
>>>> Andrea Zoppello wrote:
>>>>> Hi Gert,
>>>>>
>>>>> The route method in my opinion is to handle inonly or robust
>>>>> inonly exchange, if you want to answer you could use the answer
>>>>> method.
>>>>>
>>>>> In my opinion you must choose what you want to do when you write
>>>>> drools file.
>>>>>
>>>>> If you need to forward ( creating another exhange ) an InOnly
>>>>> exchange use helper.route instead you need to use helper.answer.
>>>>>
>>>>> This should cover all the case.
>>>>>
>>>>> Andrea
>>>>> Gert Vanthienen ha scritto:
>>>>>> Andrea,
>>>>>>
>>>>>> Actually, I was just looking at applying that. If the code in
>>>>>> your last comment goes into the routeTo method, isn't this a step
>>>>>> back from where we were? It uses send() instead of sendSync(),
>>>>>> but I no longer see any possibility of handling an InOut or
>>>>>> RobustInOnly with a Fault message, or am I missing something there?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert
>>>>>>
>>>>>> Andrea Zoppello wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>
>>>>>>> Andrea
>>>>>>> gigeril ha scritto:
>>>>>>>> Hi @ all.
>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>
>>>>>>>>
>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP
>>>>>>>> Server
>>>>>>>>
>>>>>>>> |____>HTTP BC -->
>>>>>>>> HTTP Server
>>>>>>>>
>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP
>>>>>>>> BC or the
>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>> I get a problem if the drools engine get into the message
>>>>>>>> chain. Then I only
>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports
>>>>>>>> me a
>>>>>>>> connection timeout and the connectors get stuck. I can only
>>>>>>>> press STRG+C in
>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>> Messages.
>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>> defined in
>>>>>>>> my .drl where it depends on the message content if it is send
>>>>>>>> to the tcp or
>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>
>>>>>>>> This is the output when I press STRG+C. This whole stacktrace
>>>>>>>> is printed out
>>>>>>>> 23 times.
>>>>>>>>
>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>> assembly:
>>>>>>>> droolsrouter-sa
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> droolsrouter-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> httpprovider-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> tcpconsumer-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> tcpprovider-su
>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>> (ServiceMix) stopped
>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>> ERROR - DroolsComponent - Error processing
>>>>>>>> exchange InOut[
>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>> status: Active
>>>>>>>> role: provider
>>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>>> endpoint: myRouter
>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException:
>>>>>>>> Content is not
>>>>>>>> allowed in trailing section.
>>>>>>>> ]
>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>
>>>>>>>> ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>> status to
>>>>>>>> ERROR
>>>>>>>> java.lang.IllegalStateException: component is not owner when
>>>>>>>> trying to set
>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> ... 8 more
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>
>>>>>>>> ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> So my rule.drl looks like:
>>>>>>>>
>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>
>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>
>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>
>>>>>>>>
>>>>>>>> rule "tcphttp:http"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>> null );
>>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route(
>>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>>>>>> end
>>>>>>>>
>>>>>>>> rule "tcphttp:tcp"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>> null );
>>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route(
>>>>>>>> "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>>>>> end
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>
>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>>
>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>
>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>> endpoint="myRouter"
>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>
>>>>>>>>
>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>> <drools:namespaces>
>>>>>>>> <drools:namespace
>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>> </drools:namespaces>
>>>>>>>> </drools:namespace-context>
>>>>>>>>
>>>>>>>> </beans>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Andrea Zoppello <zo...@tiscali.it>.
Hi Gert,
Waht about to make a route implementation so when an InOut Exchange
arrives it will automatically call the answer method.
BTW i cannot figure a usecase where you need to send an InOut exchange
to a drools component and then rerouting this InOut exchange to another
endpoint.
As i said to Lars if you need this capabilities you could use other
components, not drools.
Andrea
Andrea
Gert Vanthienen ha scritto:
> Andrea,
>
> Yeah, we should definitely get asynchronous support for Drools so we
> need to get this done. If the route() method before was able to
> handle InOut exchanges, we should make sure it still does to avoid
> breaking people's existing code though -- how about replacing the
> Exception being thrown at the end by a WARN log statement saying the
> same thing but still handling the Exchange in a synchronous way as
> before? This way, we still encourage people to start using answer().
>
> Gert
>
> Andrea Zoppello wrote:
>> Ok Gert,
>>
>> Probably i miss to handle the error case, but except for this, i
>> ensure i've stressed with load test the components and it works
>> correcly, under heavvy load.
>>
>> My suggestion is to start from my code to handle error case, and to
>> commit this.
>>
>> Do you agree is better to use helper.route for (InOnly / Robust
>> InOnly ) and helper.answer for InOut??
>>
>> Andrea
>> Gert Vanthienen ha scritto:
>>> Andrea,
>>>
>>> And what if the InOnly MessageExchange you forwarded ends in ERROR?
>>> The solution you proposed already answered the incoming exchange
>>> with DONE by the time you figure that out. And I think the same
>>> goes for RobustInOnly's fault message.
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> Andrea Zoppello wrote:
>>>> Hi Gert,
>>>>
>>>> The route method in my opinion is to handle inonly or robust inonly
>>>> exchange, if you want to answer you could use the answer method.
>>>>
>>>> In my opinion you must choose what you want to do when you write
>>>> drools file.
>>>>
>>>> If you need to forward ( creating another exhange ) an InOnly
>>>> exchange use helper.route instead you need to use helper.answer.
>>>>
>>>> This should cover all the case.
>>>>
>>>> Andrea
>>>> Gert Vanthienen ha scritto:
>>>>> Andrea,
>>>>>
>>>>> Actually, I was just looking at applying that. If the code in
>>>>> your last comment goes into the routeTo method, isn't this a step
>>>>> back from where we were? It uses send() instead of sendSync(),
>>>>> but I no longer see any possibility of handling an InOut or
>>>>> RobustInOnly with a Fault message, or am I missing something there?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> Andrea Zoppello wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I had the same problem, take a look to mine last comment on
>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>
>>>>>> Andrea
>>>>>> gigeril ha scritto:
>>>>>>> Hi @ all.
>>>>>>> I've following following setup of Servicemix:
>>>>>>>
>>>>>>>
>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>>
>>>>>>> |____>HTTP BC -->
>>>>>>> HTTP Server
>>>>>>>
>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP
>>>>>>> BC or the
>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>> Then I only
>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>> connection timeout and the connectors get stuck. I can only
>>>>>>> press STRG+C in
>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>> Messages.
>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>> defined in
>>>>>>> my .drl where it depends on the message content if it is send to
>>>>>>> the tcp or
>>>>>>> the http server. I also get the response back to the client.
>>>>>>>
>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>> printed out
>>>>>>> 23 times.
>>>>>>>
>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>> assembly:
>>>>>>> droolsrouter-sa
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>> unit:
>>>>>>> droolsrouter-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>> unit:
>>>>>>> httpprovider-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>> unit:
>>>>>>> tcpconsumer-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>> unit:
>>>>>>> tcpprovider-su
>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>> (ServiceMix) stopped
>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>> ERROR - DroolsComponent - Error processing
>>>>>>> exchange InOut[
>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>> status: Active
>>>>>>> role: provider
>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>> endpoint: myRouter
>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>> type="http"><text>hallo</text></message>
>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content
>>>>>>> is not
>>>>>>> allowed in trailing section.
>>>>>>> ]
>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>> status to
>>>>>>> ERROR
>>>>>>> java.lang.IllegalStateException: component is not owner when
>>>>>>> trying to set
>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> ... 8 more
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So my rule.drl looks like:
>>>>>>>
>>>>>>> package org.apache.servicemix.drools
>>>>>>>
>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>
>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>
>>>>>>>
>>>>>>> rule "tcphttp:http"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>> null );
>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route(
>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>>>>> end
>>>>>>>
>>>>>>> rule "tcphttp:tcp"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>> null );
>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route(
>>>>>>> "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>>>> end
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> My xbean.xml for the drools su:
>>>>>>>
>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>> http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>
>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>> endpoint="myRouter"
>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>> namespaceContext="#nsContext" />
>>>>>>>
>>>>>>>
>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>> <drools:namespaces>
>>>>>>> <drools:namespace
>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>> </drools:namespaces>
>>>>>>> </drools:namespace-context>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
Andrea,
Yeah, we should definitely get asynchronous support for Drools so we
need to get this done. If the route() method before was able to handle
InOut exchanges, we should make sure it still does to avoid breaking
people's existing code though -- how about replacing the Exception being
thrown at the end by a WARN log statement saying the same thing but
still handling the Exchange in a synchronous way as before? This way,
we still encourage people to start using answer().
Gert
Andrea Zoppello wrote:
> Ok Gert,
>
> Probably i miss to handle the error case, but except for this, i
> ensure i've stressed with load test the components and it works
> correcly, under heavvy load.
>
> My suggestion is to start from my code to handle error case, and to
> commit this.
>
> Do you agree is better to use helper.route for (InOnly / Robust InOnly
> ) and helper.answer for InOut??
>
> Andrea
> Gert Vanthienen ha scritto:
>> Andrea,
>>
>> And what if the InOnly MessageExchange you forwarded ends in ERROR?
>> The solution you proposed already answered the incoming exchange with
>> DONE by the time you figure that out. And I think the same goes for
>> RobustInOnly's fault message.
>>
>> Regards,
>>
>> Gert
>>
>> Andrea Zoppello wrote:
>>> Hi Gert,
>>>
>>> The route method in my opinion is to handle inonly or robust inonly
>>> exchange, if you want to answer you could use the answer method.
>>>
>>> In my opinion you must choose what you want to do when you write
>>> drools file.
>>>
>>> If you need to forward ( creating another exhange ) an InOnly
>>> exchange use helper.route instead you need to use helper.answer.
>>>
>>> This should cover all the case.
>>>
>>> Andrea
>>> Gert Vanthienen ha scritto:
>>>> Andrea,
>>>>
>>>> Actually, I was just looking at applying that. If the code in your
>>>> last comment goes into the routeTo method, isn't this a step back
>>>> from where we were? It uses send() instead of sendSync(), but I no
>>>> longer see any possibility of handling an InOut or RobustInOnly
>>>> with a Fault message, or am I missing something there?
>>>>
>>>> Regards,
>>>>
>>>> Gert
>>>>
>>>> Andrea Zoppello wrote:
>>>>> Hi,
>>>>>
>>>>> I had the same problem, take a look to mine last comment on
>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>
>>>>> Andrea
>>>>> gigeril ha scritto:
>>>>>> Hi @ all.
>>>>>> I've following following setup of Servicemix:
>>>>>>
>>>>>>
>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>
>>>>>> |____>HTTP BC -->
>>>>>> HTTP Server
>>>>>>
>>>>>> If I connect (target Service) my own written TCP BC to the HTTP
>>>>>> BC or the
>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>> Then I only
>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>> STRG+C in
>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>> Messages.
>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>> defined in
>>>>>> my .drl where it depends on the message content if it is send to
>>>>>> the tcp or
>>>>>> the http server. I also get the response back to the client.
>>>>>>
>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>> printed out
>>>>>> 23 times.
>>>>>>
>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>> assembly:
>>>>>> droolsrouter-sa
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> droolsrouter-su
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> httpprovider-su
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> tcpconsumer-su
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> tcpprovider-su
>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>> (ServiceMix) stopped
>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>> ERROR - DroolsComponent - Error processing
>>>>>> exchange InOut[
>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>> status: Active
>>>>>> role: provider
>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>> endpoint: myRouter
>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>> type="http"><text>hallo</text></message>
>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content
>>>>>> is not
>>>>>> allowed in trailing section.
>>>>>> ]
>>>>>> org.drools.spi.ConsequenceException:
>>>>>> javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>
>>>>>> )
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>
>>>>>> oker.java:20)
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>
>>>>>> ... 16 more
>>>>>> Caused by: java.lang.InterruptedException
>>>>>> at java.lang.Object.wait(Native Method)
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>
>>>>>> ... 23 more
>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>> status to
>>>>>> ERROR
>>>>>> java.lang.IllegalStateException: component is not owner when
>>>>>> trying to set
>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>> avax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>> javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>
>>>>>> )
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>
>>>>>> ... 8 more
>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>
>>>>>> oker.java:20)
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>
>>>>>> ... 16 more
>>>>>> Caused by: java.lang.InterruptedException
>>>>>> at java.lang.Object.wait(Native Method)
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>
>>>>>> ... 23 more
>>>>>>
>>>>>>
>>>>>>
>>>>>> So my rule.drl looks like:
>>>>>>
>>>>>> package org.apache.servicemix.drools
>>>>>>
>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>
>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>
>>>>>>
>>>>>> rule "tcphttp:http"
>>>>>> when
>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>> null );
>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>> then
>>>>>>
>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>> ");
>>>>>> jbi.route(
>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>>>> end
>>>>>>
>>>>>> rule "tcphttp:tcp"
>>>>>> when
>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>> null );
>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>> then
>>>>>>
>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>> ");
>>>>>> jbi.route(
>>>>>> "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>>> end
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> My xbean.xml for the drools su:
>>>>>>
>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>> http://www.springframework.org/schema/beans
>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>
>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>> endpoint="myRouter"
>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>> namespaceContext="#nsContext" />
>>>>>>
>>>>>>
>>>>>> <drools:namespace-context id="nsContext">
>>>>>> <drools:namespaces>
>>>>>> <drools:namespace
>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>> </drools:namespaces>
>>>>>> </drools:namespace-context>
>>>>>>
>>>>>> </beans>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Andrea Zoppello <zo...@tiscali.it>.
Ok Gert,
Probably i miss to handle the error case, but except for this, i ensure
i've stressed with load test the components and it works correcly, under
heavvy load.
My suggestion is to start from my code to handle error case, and to
commit this.
Do you agree is better to use helper.route for (InOnly / Robust InOnly )
and helper.answer for InOut??
Andrea
Gert Vanthienen ha scritto:
> Andrea,
>
> And what if the InOnly MessageExchange you forwarded ends in ERROR?
> The solution you proposed already answered the incoming exchange with
> DONE by the time you figure that out. And I think the same goes for
> RobustInOnly's fault message.
>
> Regards,
>
> Gert
>
> Andrea Zoppello wrote:
>> Hi Gert,
>>
>> The route method in my opinion is to handle inonly or robust inonly
>> exchange, if you want to answer you could use the answer method.
>>
>> In my opinion you must choose what you want to do when you write
>> drools file.
>>
>> If you need to forward ( creating another exhange ) an InOnly
>> exchange use helper.route instead you need to use helper.answer.
>>
>> This should cover all the case.
>>
>> Andrea
>> Gert Vanthienen ha scritto:
>>> Andrea,
>>>
>>> Actually, I was just looking at applying that. If the code in your
>>> last comment goes into the routeTo method, isn't this a step back
>>> from where we were? It uses send() instead of sendSync(), but I no
>>> longer see any possibility of handling an InOut or RobustInOnly with
>>> a Fault message, or am I missing something there?
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> Andrea Zoppello wrote:
>>>> Hi,
>>>>
>>>> I had the same problem, take a look to mine last comment on
>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>
>>>> Andrea
>>>> gigeril ha scritto:
>>>>> Hi @ all.
>>>>> I've following following setup of Servicemix:
>>>>>
>>>>>
>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>
>>>>> |____>HTTP BC -->
>>>>> HTTP Server
>>>>>
>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>> or the
>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>> I get a problem if the drools engine get into the message chain.
>>>>> Then I only
>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>> connection timeout and the connectors get stuck. I can only press
>>>>> STRG+C in
>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>> Messages.
>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>> defined in
>>>>> my .drl where it depends on the message content if it is send to
>>>>> the tcp or
>>>>> the http server. I also get the response back to the client.
>>>>>
>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>> printed out
>>>>> 23 times.
>>>>>
>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>> assembly:
>>>>> droolsrouter-sa
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> droolsrouter-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> httpprovider-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> tcpconsumer-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> tcpprovider-su
>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>> (ServiceMix) stopped
>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>> InOut[
>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>> status: Active
>>>>> role: provider
>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>> endpoint: myRouter
>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>> type="http"><text>hallo</text></message>
>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content
>>>>> is not
>>>>> allowed in trailing section.
>>>>> ]
>>>>> org.drools.spi.ConsequenceException:
>>>>> javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>
>>>>> )
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>
>>>>> oker.java:20)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>
>>>>> ... 16 more
>>>>> Caused by: java.lang.InterruptedException
>>>>> at java.lang.Object.wait(Native Method)
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>
>>>>> ... 23 more
>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>> status to
>>>>> ERROR
>>>>> java.lang.IllegalStateException: component is not owner when
>>>>> trying to set
>>>>> error: org.drools.spi.ConsequenceException: j
>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>> javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>
>>>>> )
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>
>>>>> ... 8 more
>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>
>>>>> oker.java:20)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>
>>>>> ... 16 more
>>>>> Caused by: java.lang.InterruptedException
>>>>> at java.lang.Object.wait(Native Method)
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>
>>>>> ... 23 more
>>>>>
>>>>>
>>>>>
>>>>> So my rule.drl looks like:
>>>>>
>>>>> package org.apache.servicemix.drools
>>>>>
>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>
>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>
>>>>>
>>>>> rule "tcphttp:http"
>>>>> when
>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>> null );
>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>> then
>>>>>
>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>> ");
>>>>> jbi.route(
>>>>> "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>>> end
>>>>>
>>>>> rule "tcphttp:tcp"
>>>>> when
>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>> null );
>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>> then
>>>>>
>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>> ");
>>>>> jbi.route(
>>>>> "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>> end
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> My xbean.xml for the drools su:
>>>>>
>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>> http://www.springframework.org/schema/beans
>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>
>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>> endpoint="myRouter"
>>>>> ruleBaseResource="classpath:rule.drl"
>>>>> namespaceContext="#nsContext" />
>>>>>
>>>>>
>>>>> <drools:namespace-context id="nsContext">
>>>>> <drools:namespaces>
>>>>> <drools:namespace
>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>> </drools:namespaces>
>>>>> </drools:namespace-context>
>>>>>
>>>>> </beans>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
Andrea,
And what if the InOnly MessageExchange you forwarded ends in ERROR? The
solution you proposed already answered the incoming exchange with DONE
by the time you figure that out. And I think the same goes for
RobustInOnly's fault message.
Regards,
Gert
Andrea Zoppello wrote:
> Hi Gert,
>
> The route method in my opinion is to handle inonly or robust inonly
> exchange, if you want to answer you could use the answer method.
>
> In my opinion you must choose what you want to do when you write
> drools file.
>
> If you need to forward ( creating another exhange ) an InOnly exchange
> use helper.route instead you need to use helper.answer.
>
> This should cover all the case.
>
> Andrea
> Gert Vanthienen ha scritto:
>> Andrea,
>>
>> Actually, I was just looking at applying that. If the code in your
>> last comment goes into the routeTo method, isn't this a step back
>> from where we were? It uses send() instead of sendSync(), but I no
>> longer see any possibility of handling an InOut or RobustInOnly with
>> a Fault message, or am I missing something there?
>>
>> Regards,
>>
>> Gert
>>
>> Andrea Zoppello wrote:
>>> Hi,
>>>
>>> I had the same problem, take a look to mine last comment on
>>> https://issues.apache.org/activemq/browse/SM-1248
>>>
>>> Andrea
>>> gigeril ha scritto:
>>>> Hi @ all.
>>>> I've following following setup of Servicemix:
>>>>
>>>>
>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>
>>>> |____>HTTP BC -->
>>>> HTTP Server
>>>>
>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>> or the
>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>> I get a problem if the drools engine get into the message chain.
>>>> Then I only
>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>> connection timeout and the connectors get stuck. I can only press
>>>> STRG+C in
>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>> Messages.
>>>> This sending of this 23 Messages work fine. They take the way I
>>>> defined in
>>>> my .drl where it depends on the message content if it is send to
>>>> the tcp or
>>>> the http server. I also get the response back to the client.
>>>>
>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>> printed out
>>>> 23 times.
>>>>
>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>> assembly:
>>>> droolsrouter-sa
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> droolsrouter-su
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> httpprovider-su
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> tcpconsumer-su
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> tcpprovider-su
>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>> (ServiceMix) stopped
>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>> ERROR - DroolsComponent - Error processing exchange
>>>> InOut[
>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>> status: Active
>>>> role: provider
>>>> service: {http://knapp.com/tcphttp}myRouter
>>>> endpoint: myRouter
>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>> type="http"><text>hallo</text></message>
>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>> not
>>>> allowed in trailing section.
>>>> ]
>>>> org.drools.spi.ConsequenceException:
>>>> javax.jbi.messaging.MessagingException:
>>>> java.lang.InterruptedException
>>>> at
>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>
>>>> )
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>
>>>> at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>> java.lang.InterruptedException
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>
>>>> at
>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>
>>>> oker.java:20)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>> ... 16 more
>>>> Caused by: java.lang.InterruptedException
>>>> at java.lang.Object.wait(Native Method)
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>
>>>> ... 23 more
>>>> ERROR - DroolsComponent - Error setting exchange
>>>> status to
>>>> ERROR
>>>> java.lang.IllegalStateException: component is not owner when trying
>>>> to set
>>>> error: org.drools.spi.ConsequenceException: j
>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>> at
>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>
>>>> at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>> Caused by: org.drools.spi.ConsequenceException:
>>>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>> at
>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>
>>>> )
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>
>>>> ... 8 more
>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>> java.lang.InterruptedException
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>
>>>> at
>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>
>>>> oker.java:20)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>> ... 16 more
>>>> Caused by: java.lang.InterruptedException
>>>> at java.lang.Object.wait(Native Method)
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>
>>>> ... 23 more
>>>>
>>>>
>>>>
>>>> So my rule.drl looks like:
>>>>
>>>> package org.apache.servicemix.drools
>>>>
>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>
>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>
>>>>
>>>> rule "tcphttp:http"
>>>> when
>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>> null );
>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>> then
>>>>
>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>> ");
>>>> jbi.route(
>>>> "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>> end
>>>>
>>>> rule "tcphttp:tcp"
>>>> when
>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>> null );
>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>> then
>>>>
>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>> end
>>>>
>>>>
>>>>
>>>>
>>>> My xbean.xml for the drools su:
>>>>
>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>> xmlns="http://www.springframework.org/schema/beans"
>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>> http://www.springframework.org/schema/beans
>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>
>>>> <drools:endpoint service="tcphttp:myRouter"
>>>> endpoint="myRouter"
>>>> ruleBaseResource="classpath:rule.drl"
>>>> namespaceContext="#nsContext" />
>>>>
>>>>
>>>> <drools:namespace-context id="nsContext">
>>>> <drools:namespaces>
>>>> <drools:namespace
>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>> </drools:namespaces>
>>>> </drools:namespace-context>
>>>>
>>>> </beans>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Andrea Zoppello <zo...@tiscali.it>.
Hi Gert,
The route method in my opinion is to handle inonly or robust inonly
exchange, if you want to answer you could use the answer method.
In my opinion you must choose what you want to do when you write drools
file.
If you need to forward ( creating another exhange ) an InOnly exchange
use helper.route instead you need to use helper.answer.
This should cover all the case.
Andrea
Gert Vanthienen ha scritto:
> Andrea,
>
> Actually, I was just looking at applying that. If the code in your
> last comment goes into the routeTo method, isn't this a step back from
> where we were? It uses send() instead of sendSync(), but I no longer
> see any possibility of handling an InOut or RobustInOnly with a Fault
> message, or am I missing something there?
>
> Regards,
>
> Gert
>
> Andrea Zoppello wrote:
>> Hi,
>>
>> I had the same problem, take a look to mine last comment on
>> https://issues.apache.org/activemq/browse/SM-1248
>>
>> Andrea
>> gigeril ha scritto:
>>> Hi @ all.
>>> I've following following setup of Servicemix:
>>>
>>>
>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>> |____>HTTP
>>> BC -->
>>> HTTP Server
>>>
>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>> or the
>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>> I get a problem if the drools engine get into the message chain.
>>> Then I only
>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>> connection timeout and the connectors get stuck. I can only press
>>> STRG+C in
>>> the Servicemix Console Window to restart Servicemix and send 23
>>> Messages.
>>> This sending of this 23 Messages work fine. They take the way I
>>> defined in
>>> my .drl where it depends on the message content if it is send to the
>>> tcp or
>>> the http server. I also get the response back to the client.
>>>
>>> This is the output when I press STRG+C. This whole stacktrace is
>>> printed out
>>> 23 times.
>>>
>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>> assembly:
>>> droolsrouter-sa
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> droolsrouter-su
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> httpprovider-su
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> tcpconsumer-su
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> tcpprovider-su
>>> INFO - JBIContainer - ServiceMix JBI Container
>>> (ServiceMix) stopped
>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>> ERROR - DroolsComponent - Error processing exchange
>>> InOut[
>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>> status: Active
>>> role: provider
>>> service: {http://knapp.com/tcphttp}myRouter
>>> endpoint: myRouter
>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>> type="http"><text>hallo</text></message>
>>> out: Unable to display: org.xml.sax.SAXParseException: Content is not
>>> allowed in trailing section.
>>> ]
>>> org.drools.spi.ConsequenceException:
>>> javax.jbi.messaging.MessagingException:
>>> java.lang.InterruptedException
>>> at
>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>
>>> )
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>> at
>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>
>>> at
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: javax.jbi.messaging.MessagingException:
>>> java.lang.InterruptedException
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>
>>> at
>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>
>>> oker.java:20)
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>> ... 16 more
>>> Caused by: java.lang.InterruptedException
>>> at java.lang.Object.wait(Native Method)
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>
>>> ... 23 more
>>> ERROR - DroolsComponent - Error setting exchange
>>> status to
>>> ERROR
>>> java.lang.IllegalStateException: component is not owner when trying
>>> to set
>>> error: org.drools.spi.ConsequenceException: j
>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>> at
>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>
>>> at
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: org.drools.spi.ConsequenceException:
>>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>> at
>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>
>>> )
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>> at
>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>
>>> ... 8 more
>>> Caused by: javax.jbi.messaging.MessagingException:
>>> java.lang.InterruptedException
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>
>>> at
>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>
>>> oker.java:20)
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>> ... 16 more
>>> Caused by: java.lang.InterruptedException
>>> at java.lang.Object.wait(Native Method)
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>
>>> ... 23 more
>>>
>>>
>>>
>>> So my rule.drl looks like:
>>>
>>> package org.apache.servicemix.drools
>>>
>>> import org.apache.servicemix.drools.model.Exchange;
>>>
>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>
>>>
>>> rule "tcphttp:http"
>>> when
>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>> then
>>>
>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>> ");
>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
>>> end
>>>
>>> rule "tcphttp:tcp"
>>> when
>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>> then
>>>
>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>> end
>>>
>>>
>>>
>>>
>>> My xbean.xml for the drools su:
>>>
>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>> xmlns="http://www.springframework.org/schema/beans"
>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>> http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>
>>> <drools:endpoint service="tcphttp:myRouter"
>>> endpoint="myRouter"
>>> ruleBaseResource="classpath:rule.drl"
>>> namespaceContext="#nsContext" />
>>>
>>>
>>> <drools:namespace-context id="nsContext">
>>> <drools:namespaces>
>>> <drools:namespace
>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>> </drools:namespaces>
>>> </drools:namespace-context>
>>>
>>> </beans>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by gigeril <ma...@knapp.com>.
Thank you very much!!! That solved the problem! I didn't know that I have to
explicitely call the done(exchange) methode, because when I implemented the
TCP BC it worked fine without that call in connection with the http binding
component!
Gert Vanthienen wrote:
>
> L.S.,
>
> Re-reading the stack again, it looks as if your own TCP BC doesn't
> answer the InOut exchange with a DONE after it accepted the response.
> If you look at the diagram near the bottom on page
> http://servicemix.apache.org/5-jbi.html, I'm guessing you never send the
> DONE message in step 5.
>
> Gert
>
> gigeril wrote:
>> If I send my 23 Message and then look into servicemix with jconsole I see
>> 16
>> drools Threads are waiting for exchange:
>>
>> Name: pool-flow.seda.servicemix-drools-thread-1
>> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
>> Total blocked: 0 Total waited: 2
>>
>> Stack trace:
>> java.lang.Object.wait(Native Method)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>> - locked org.drools.common.DefaultAgenda@273cef
>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> java.lang.Thread.run(Thread.java:619)
>>
>>
>>
>>
>>
>>
>>
>>
>> gigeril wrote:
>>
>>> But if it is going back trough the drools endpoint why is the sendsync
>>> thread in the drools endpoint still opened ?
>>>
>>>
>>>
>>>
>>>
>>> Gert Vanthienen wrote:
>>>
>>>> L.S.,
>>>>
>>>> It is going back through the Drools component. If you look at the
>>>> JBIHelper, you'll find code like this:
>>>> getChannel().sendSync(newMe);
>>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>>> me.setStatus(ExchangeStatus.DONE);
>>>> getChannel().send(me);
>>>> ...
>>>>
>>>> In the snippet above, the newMe is the Exchange being sent from the the
>>>> Drools helper. After it returns (using sendSync), the exchange that
>>>> came into the drools endpoint is being answered (just with DONE here,
>>>> but there are other paths the code that return message content and
>>>> faults).
>>>>
>>>> Regards,
>>>>
>>>> Gert
>>>>
>>>> gigeril wrote:
>>>>
>>>>> I don't unterstand the message flow trough servicemix when using
>>>>> drools
>>>>> component. If I am sending a request (INOUT Pattern), and this request
>>>>> passes the drools endpoint and get forwarded to the TCP or HTTP
>>>>> Endpoint
>>>>> how
>>>>> does the response get back to my client? Over the drools endpoint or
>>>>> does
>>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>>
>>>>> I think that it sends it directly but the drools endpoint also waits
>>>>> for
>>>>> the
>>>>> response and so it is waiting and waiting and no sendSync answer is
>>>>> send
>>>>> to
>>>>> it because it was already send to the consumer Endpoint.
>>>>>
>>>>> I ask this, because I always get the right response to my client.
>>>>>
>>>>> What can I do avoid this issue?
>>>>>
>>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Gert Vanthienen wrote:
>>>>>
>>>>>
>>>>>> Andrea,
>>>>>>
>>>>>> Actually, I was just looking at applying that. If the code in your
>>>>>> last
>>>>>> comment goes into the routeTo method, isn't this a step back from
>>>>>> where
>>>>>> we were? It uses send() instead of sendSync(), but I no longer see
>>>>>> any
>>>>>> possibility of handling an InOut or RobustInOnly with a Fault
>>>>>> message,
>>>>>> or am I missing something there?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert
>>>>>>
>>>>>> Andrea Zoppello wrote:
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>
>>>>>>> Andrea
>>>>>>> gigeril ha scritto:
>>>>>>>
>>>>>>>
>>>>>>>> Hi @ all.
>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>
>>>>>>>>
>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>>>
>>>>>>>> |____>HTTP
>>>>>>>> BC -->
>>>>>>>> HTTP Server
>>>>>>>>
>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>>>>> or
>>>>>>>> the
>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>>> Then
>>>>>>>> I only
>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>>> STRG+C in
>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>> Messages.
>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>> defined in
>>>>>>>> my .drl where it depends on the message content if it is send to
>>>>>>>> the
>>>>>>>> tcp or
>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>
>>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>>> printed out
>>>>>>>> 23 times.
>>>>>>>>
>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>> assembly:
>>>>>>>> droolsrouter-sa
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> droolsrouter-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> httpprovider-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> tcpconsumer-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> tcpprovider-su
>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>> (ServiceMix) stopped
>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>>> InOut[
>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>> status: Active
>>>>>>>> role: provider
>>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>>> endpoint: myRouter
>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>>> not
>>>>>>>> allowed in trailing section.
>>>>>>>> ]
>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>> ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>> status to
>>>>>>>> ERROR
>>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>>> to set
>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>>
>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> ... 8 more
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>> ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> So my rule.drl looks like:
>>>>>>>>
>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>
>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>
>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>
>>>>>>>>
>>>>>>>> rule "tcphttp:http"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>> null
>>>>>>>> );
>>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route(
>>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>>> );
>>>>>>>> end
>>>>>>>>
>>>>>>>> rule "tcphttp:tcp"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>> null
>>>>>>>> );
>>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>>> );
>>>>>>>> end
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>
>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>
>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>> endpoint="myRouter"
>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>
>>>>>>>>
>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>> <drools:namespaces>
>>>>>>>> <drools:namespace
>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>> </drools:namespaces>
>>>>>>>> </drools:namespace-context>
>>>>>>>>
>>>>>>>> </beans>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> -----
>>>>>> ---
>>>>>> Gert Vanthienen
>>>>>> http://www.anova.be
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> -----
>>>> ---
>>>> Gert Vanthienen
>>>> http://www.anova.be
>>>>
>>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18851349.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
Re-reading the stack again, it looks as if your own TCP BC doesn't
answer the InOut exchange with a DONE after it accepted the response.
If you look at the diagram near the bottom on page
http://servicemix.apache.org/5-jbi.html, I'm guessing you never send the
DONE message in step 5.
Gert
gigeril wrote:
> If I send my 23 Message and then look into servicemix with jconsole I see 16
> drools Threads are waiting for exchange:
>
> Name: pool-flow.seda.servicemix-drools-thread-1
> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
> Total blocked: 0 Total waited: 2
>
> Stack trace:
> java.lang.Object.wait(Native Method)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> - locked org.drools.common.DefaultAgenda@273cef
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> java.lang.Thread.run(Thread.java:619)
>
>
>
>
>
>
>
>
> gigeril wrote:
>
>> But if it is going back trough the drools endpoint why is the sendsync
>> thread in the drools endpoint still opened ?
>>
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> It is going back through the Drools component. If you look at the
>>> JBIHelper, you'll find code like this:
>>> getChannel().sendSync(newMe);
>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>> me.setStatus(ExchangeStatus.DONE);
>>> getChannel().send(me);
>>> ...
>>>
>>> In the snippet above, the newMe is the Exchange being sent from the the
>>> Drools helper. After it returns (using sendSync), the exchange that
>>> came into the drools endpoint is being answered (just with DONE here,
>>> but there are other paths the code that return message content and
>>> faults).
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> gigeril wrote:
>>>
>>>> I don't unterstand the message flow trough servicemix when using drools
>>>> component. If I am sending a request (INOUT Pattern), and this request
>>>> passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint
>>>> how
>>>> does the response get back to my client? Over the drools endpoint or
>>>> does
>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>
>>>> I think that it sends it directly but the drools endpoint also waits for
>>>> the
>>>> response and so it is waiting and waiting and no sendSync answer is send
>>>> to
>>>> it because it was already send to the consumer Endpoint.
>>>>
>>>> I ask this, because I always get the right response to my client.
>>>>
>>>> What can I do avoid this issue?
>>>>
>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>
>>>>
>>>>> Andrea,
>>>>>
>>>>> Actually, I was just looking at applying that. If the code in your
>>>>> last
>>>>> comment goes into the routeTo method, isn't this a step back from where
>>>>> we were? It uses send() instead of sendSync(), but I no longer see any
>>>>> possibility of handling an InOut or RobustInOnly with a Fault message,
>>>>> or am I missing something there?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> Andrea Zoppello wrote:
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I had the same problem, take a look to mine last comment on
>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>
>>>>>> Andrea
>>>>>> gigeril ha scritto:
>>>>>>
>>>>>>
>>>>>>> Hi @ all.
>>>>>>> I've following following setup of Servicemix:
>>>>>>>
>>>>>>>
>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>> |____>HTTP
>>>>>>> BC -->
>>>>>>> HTTP Server
>>>>>>>
>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>>>>>> the
>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>> I get a problem if the drools engine get into the message chain. Then
>>>>>>> I only
>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>> STRG+C in
>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>> Messages.
>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>> defined in
>>>>>>> my .drl where it depends on the message content if it is send to the
>>>>>>> tcp or
>>>>>>> the http server. I also get the response back to the client.
>>>>>>>
>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>> printed out
>>>>>>> 23 times.
>>>>>>>
>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>> assembly:
>>>>>>> droolsrouter-sa
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> droolsrouter-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> httpprovider-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpconsumer-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpprovider-su
>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>> (ServiceMix) stopped
>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>> InOut[
>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>> status: Active
>>>>>>> role: provider
>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>> endpoint: myRouter
>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>> type="http"><text>hallo</text></message>
>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>> not
>>>>>>> allowed in trailing section.
>>>>>>> ]
>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>> status to
>>>>>>> ERROR
>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>> to set
>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> ... 8 more
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So my rule.drl looks like:
>>>>>>>
>>>>>>> package org.apache.servicemix.drools
>>>>>>>
>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>
>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>
>>>>>>>
>>>>>>> rule "tcphttp:http"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> );
>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>> );
>>>>>>> end
>>>>>>>
>>>>>>> rule "tcphttp:tcp"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> );
>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>> );
>>>>>>> end
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> My xbean.xml for the drools su:
>>>>>>>
>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>> http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>
>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>> endpoint="myRouter"
>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>> namespaceContext="#nsContext" />
>>>>>>>
>>>>>>>
>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>> <drools:namespaces>
>>>>>>> <drools:namespace
>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>> </drools:namespaces>
>>>>>>> </drools:namespace-context>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://www.anova.be
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Ulhas Bhole <ul...@iona.com>.
Hi gigeril,
I don't know anything about drools but looks like the symptoms you are
seeing are very much similar to what I saw in one of http binding
component issues. If you are using latest 3.2 branch or ServiceMix 3
trunk build then try increasing threadpool size for you jetty httpClient
to see if it helps.
Here is how you can do it. (Add following line to
conf/component.properties file.
servicemix-http.jettyClientThreadPoolSize=33
Regards,
Ulhas Bhole
gigeril wrote:
> If I send my 23 Message and then look into servicemix with jconsole I see 16
> drools Threads are waiting for exchange:
>
> Name: pool-flow.seda.servicemix-drools-thread-1
> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
> Total blocked: 0 Total waited: 2
>
> Stack trace:
> java.lang.Object.wait(Native Method)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> - locked org.drools.common.DefaultAgenda@273cef
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> java.lang.Thread.run(Thread.java:619)
>
>
>
>
>
>
>
>
> gigeril wrote:
>
>> But if it is going back trough the drools endpoint why is the sendsync
>> thread in the drools endpoint still opened ?
>>
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> It is going back through the Drools component. If you look at the
>>> JBIHelper, you'll find code like this:
>>> getChannel().sendSync(newMe);
>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>> me.setStatus(ExchangeStatus.DONE);
>>> getChannel().send(me);
>>> ...
>>>
>>> In the snippet above, the newMe is the Exchange being sent from the the
>>> Drools helper. After it returns (using sendSync), the exchange that
>>> came into the drools endpoint is being answered (just with DONE here,
>>> but there are other paths the code that return message content and
>>> faults).
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> gigeril wrote:
>>>
>>>> I don't unterstand the message flow trough servicemix when using drools
>>>> component. If I am sending a request (INOUT Pattern), and this request
>>>> passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint
>>>> how
>>>> does the response get back to my client? Over the drools endpoint or
>>>> does
>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>
>>>> I think that it sends it directly but the drools endpoint also waits for
>>>> the
>>>> response and so it is waiting and waiting and no sendSync answer is send
>>>> to
>>>> it because it was already send to the consumer Endpoint.
>>>>
>>>> I ask this, because I always get the right response to my client.
>>>>
>>>> What can I do avoid this issue?
>>>>
>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>
>>>>
>>>>> Andrea,
>>>>>
>>>>> Actually, I was just looking at applying that. If the code in your
>>>>> last
>>>>> comment goes into the routeTo method, isn't this a step back from where
>>>>> we were? It uses send() instead of sendSync(), but I no longer see any
>>>>> possibility of handling an InOut or RobustInOnly with a Fault message,
>>>>> or am I missing something there?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> Andrea Zoppello wrote:
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I had the same problem, take a look to mine last comment on
>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>
>>>>>> Andrea
>>>>>> gigeril ha scritto:
>>>>>>
>>>>>>
>>>>>>> Hi @ all.
>>>>>>> I've following following setup of Servicemix:
>>>>>>>
>>>>>>>
>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>> |____>HTTP
>>>>>>> BC -->
>>>>>>> HTTP Server
>>>>>>>
>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>>>>>> the
>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>> I get a problem if the drools engine get into the message chain. Then
>>>>>>> I only
>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>> STRG+C in
>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>> Messages.
>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>> defined in
>>>>>>> my .drl where it depends on the message content if it is send to the
>>>>>>> tcp or
>>>>>>> the http server. I also get the response back to the client.
>>>>>>>
>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>> printed out
>>>>>>> 23 times.
>>>>>>>
>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>> assembly:
>>>>>>> droolsrouter-sa
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> droolsrouter-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> httpprovider-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpconsumer-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpprovider-su
>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>> (ServiceMix) stopped
>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>> InOut[
>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>> status: Active
>>>>>>> role: provider
>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>> endpoint: myRouter
>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>> type="http"><text>hallo</text></message>
>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>> not
>>>>>>> allowed in trailing section.
>>>>>>> ]
>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>> status to
>>>>>>> ERROR
>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>> to set
>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> ... 8 more
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So my rule.drl looks like:
>>>>>>>
>>>>>>> package org.apache.servicemix.drools
>>>>>>>
>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>
>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>
>>>>>>>
>>>>>>> rule "tcphttp:http"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> );
>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>> );
>>>>>>> end
>>>>>>>
>>>>>>> rule "tcphttp:tcp"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> );
>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>> );
>>>>>>> end
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> My xbean.xml for the drools su:
>>>>>>>
>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>> http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>
>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>> endpoint="myRouter"
>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>> namespaceContext="#nsContext" />
>>>>>>>
>>>>>>>
>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>> <drools:namespaces>
>>>>>>> <drools:namespace
>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>> </drools:namespaces>
>>>>>>> </drools:namespace-context>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://www.anova.be
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>
>
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by gigeril <ma...@knapp.com>.
If the tcp client sends <message type="tcp"><text>hallo</text></message> then
the tcp bc/ the tcpserver get the message.
If the tcp client sends <message type="http"><text>hallo</text></message>
then the http bc/ the http server get the message.
I read this out of the message using xpatch in my .drl file:
package org.apache.servicemix.drools
import org.apache.servicemix.drools.model.Exchange;
global org.apache.servicemix.drools.model.JbiHelper jbi;
rule "tcphttp:http"
when
me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
eval( inmsg.xpath("/message/@type = \"http\""))
then
System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
end
rule "tcphttp:tcp"
when
me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
eval( inmsg.xpath("/message/@type = \"tcp\""));
then
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
end
Gert Vanthienen wrote:
>
> L.S.,
>
> Strange... the Drools JBIHelper routeTo() is waiting for something
> though. Perhaps it's another rule trying to send something that gets
> stuck. Once you're out of Drools components threads, everything will
> stop. Perhaps Ulhas is onto something with the remark about the Jetty
> in the HTTP component. I see the diagram also mentions the HTTP BC.
> How is the message being send to that endpoint?
>
> Regards,
>
> Gert
>
> gigeril wrote:
>> But why should it not come back to the drools endpoint?? It gets back to
>> my
>> client!! To define it a little bit cleaner:
>>
>> TCP Client sends the Message <message
>> type=\"tcp\"><text>hallo</text></message>
>> The TCP BC takes it and route the message to the TCP Provider Endpoint
>> because the value of the property "type" is tcp. Then the TCP Provider
>> Component takes it and sends it to the TCP Server. The TCP Server takes
>> the
>> "hallo" out of the message, replace it with "blaaba" and sends it back.
>> Then
>> I print the response that the client gets and I see the correct message
>> <message type=\"tcp\"><text>blaaba</text></message>.
>>
>> So the whole message flow works but only for 23 Messages. I can'T follow
>> you
>> if you say that the drools endpoint doesn't get a response from any of
>> the
>> binding component.
>>
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> That would be because the InOut message exchange never gets back to the
>>> drools endpoint. What are you sending it to? Is it possible that the
>>> target component somehow fails to send the correct response back?
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> gigeril wrote:
>>>
>>>> If I send my 23 Message and then look into servicemix with jconsole I
>>>> see
>>>> 16
>>>> drools Threads are waiting for exchange:
>>>>
>>>> Name: pool-flow.seda.servicemix-drools-thread-1
>>>> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
>>>> Total blocked: 0 Total waited: 2
>>>>
>>>> Stack trace:
>>>> java.lang.Object.wait(Native Method)
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>> - locked org.drools.common.DefaultAgenda@273cef
>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>> java.lang.Thread.run(Thread.java:619)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> gigeril wrote:
>>>>
>>>>
>>>>> But if it is going back trough the drools endpoint why is the sendsync
>>>>> thread in the drools endpoint still opened ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Gert Vanthienen wrote:
>>>>>
>>>>>
>>>>>> L.S.,
>>>>>>
>>>>>> It is going back through the Drools component. If you look at the
>>>>>> JBIHelper, you'll find code like this:
>>>>>> getChannel().sendSync(newMe);
>>>>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>>>>> me.setStatus(ExchangeStatus.DONE);
>>>>>> getChannel().send(me);
>>>>>> ...
>>>>>>
>>>>>> In the snippet above, the newMe is the Exchange being sent from the
>>>>>> the
>>>>>> Drools helper. After it returns (using sendSync), the exchange that
>>>>>> came into the drools endpoint is being answered (just with DONE here,
>>>>>> but there are other paths the code that return message content and
>>>>>> faults).
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert
>>>>>>
>>>>>> gigeril wrote:
>>>>>>
>>>>>>
>>>>>>> I don't unterstand the message flow trough servicemix when using
>>>>>>> drools
>>>>>>> component. If I am sending a request (INOUT Pattern), and this
>>>>>>> request
>>>>>>> passes the drools endpoint and get forwarded to the TCP or HTTP
>>>>>>> Endpoint
>>>>>>> how
>>>>>>> does the response get back to my client? Over the drools endpoint or
>>>>>>> does
>>>>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>>>>
>>>>>>> I think that it sends it directly but the drools endpoint also waits
>>>>>>> for
>>>>>>> the
>>>>>>> response and so it is waiting and waiting and no sendSync answer is
>>>>>>> send
>>>>>>> to
>>>>>>> it because it was already send to the consumer Endpoint.
>>>>>>>
>>>>>>> I ask this, because I always get the right response to my client.
>>>>>>>
>>>>>>> What can I do avoid this issue?
>>>>>>>
>>>>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Gert Vanthienen wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Andrea,
>>>>>>>>
>>>>>>>> Actually, I was just looking at applying that. If the code in your
>>>>>>>> last
>>>>>>>> comment goes into the routeTo method, isn't this a step back from
>>>>>>>> where
>>>>>>>> we were? It uses send() instead of sendSync(), but I no longer see
>>>>>>>> any
>>>>>>>> possibility of handling an InOut or RobustInOnly with a Fault
>>>>>>>> message,
>>>>>>>> or am I missing something there?
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Gert
>>>>>>>>
>>>>>>>> Andrea Zoppello wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>>>
>>>>>>>>> Andrea
>>>>>>>>> gigeril ha scritto:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Hi @ all.
>>>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP
>>>>>>>>>> Server
>>>>>>>>>>
>>>>>>>>>> |____>HTTP
>>>>>>>>>> BC -->
>>>>>>>>>> HTTP Server
>>>>>>>>>>
>>>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP
>>>>>>>>>> BC
>>>>>>>>>> or
>>>>>>>>>> the
>>>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>>>>> Then
>>>>>>>>>> I only
>>>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me
>>>>>>>>>> a
>>>>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>>>>> STRG+C in
>>>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>>>> Messages.
>>>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>>>> defined in
>>>>>>>>>> my .drl where it depends on the message content if it is send to
>>>>>>>>>> the
>>>>>>>>>> tcp or
>>>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>>>
>>>>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>>>>> printed out
>>>>>>>>>> 23 times.
>>>>>>>>>>
>>>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>>>> assembly:
>>>>>>>>>> droolsrouter-sa
>>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>>> unit:
>>>>>>>>>> droolsrouter-su
>>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>>> unit:
>>>>>>>>>> httpprovider-su
>>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>>> unit:
>>>>>>>>>> tcpconsumer-su
>>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>>> unit:
>>>>>>>>>> tcpprovider-su
>>>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>>>> (ServiceMix) stopped
>>>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>>>> ERROR - DroolsComponent - Error processing
>>>>>>>>>> exchange
>>>>>>>>>> InOut[
>>>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>>>> status: Active
>>>>>>>>>> role: provider
>>>>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>>>>> endpoint: myRouter
>>>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content
>>>>>>>>>> is
>>>>>>>>>> not
>>>>>>>>>> allowed in trailing section.
>>>>>>>>>> ]
>>>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>>>> java.lang.InterruptedException
>>>>>>>>>> at
>>>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>>>
>>>>>>>>>> )
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>>>
>>>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>>>> java.lang.InterruptedException
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>>>
>>>>>>>>>> oker.java:20)
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>>> ... 16 more
>>>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>>>
>>>>>>>>>> ... 23 more
>>>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>>>> status to
>>>>>>>>>> ERROR
>>>>>>>>>> java.lang.IllegalStateException: component is not owner when
>>>>>>>>>> trying
>>>>>>>>>> to set
>>>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>>>> java.lang.InterruptedException
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>>>
>>>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>>>> java.lang.InterruptedException
>>>>>>>>>> at
>>>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>>>
>>>>>>>>>> )
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>>>
>>>>>>>>>> ... 8 more
>>>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>>>> java.lang.InterruptedException
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>>>
>>>>>>>>>> oker.java:20)
>>>>>>>>>> at
>>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>>> ... 16 more
>>>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>>>
>>>>>>>>>> ... 23 more
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> So my rule.drl looks like:
>>>>>>>>>>
>>>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>>>
>>>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>>>
>>>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> rule "tcphttp:http"
>>>>>>>>>> when
>>>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>>>> null
>>>>>>>>>> );
>>>>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>>>> then
>>>>>>>>>>
>>>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>>>> ");
>>>>>>>>>> jbi.route(
>>>>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>>>>> );
>>>>>>>>>> end
>>>>>>>>>>
>>>>>>>>>> rule "tcphttp:tcp"
>>>>>>>>>> when
>>>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>>>> null
>>>>>>>>>> );
>>>>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>>>> then
>>>>>>>>>>
>>>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>>>> ");
>>>>>>>>>> jbi.route(
>>>>>>>>>> "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>>>>> );
>>>>>>>>>> end
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>>>
>>>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>>>>
>>>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>>>
>>>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>>>
>>>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>>>> endpoint="myRouter"
>>>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>>>> <drools:namespaces>
>>>>>>>>>> <drools:namespace
>>>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>>>> </drools:namespaces>
>>>>>>>>>> </drools:namespace-context>
>>>>>>>>>>
>>>>>>>>>> </beans>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> -----
>>>>>>>> ---
>>>>>>>> Gert Vanthienen
>>>>>>>> http://www.anova.be
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> -----
>>>>>> ---
>>>>>> Gert Vanthienen
>>>>>> http://www.anova.be
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18848713.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
Strange... the Drools JBIHelper routeTo() is waiting for something
though. Perhaps it's another rule trying to send something that gets
stuck. Once you're out of Drools components threads, everything will
stop. Perhaps Ulhas is onto something with the remark about the Jetty
in the HTTP component. I see the diagram also mentions the HTTP BC.
How is the message being send to that endpoint?
Regards,
Gert
gigeril wrote:
> But why should it not come back to the drools endpoint?? It gets back to my
> client!! To define it a little bit cleaner:
>
> TCP Client sends the Message <message
> type=\"tcp\"><text>hallo</text></message>
> The TCP BC takes it and route the message to the TCP Provider Endpoint
> because the value of the property "type" is tcp. Then the TCP Provider
> Component takes it and sends it to the TCP Server. The TCP Server takes the
> "hallo" out of the message, replace it with "blaaba" and sends it back. Then
> I print the response that the client gets and I see the correct message
> <message type=\"tcp\"><text>blaaba</text></message>.
>
> So the whole message flow works but only for 23 Messages. I can'T follow you
> if you say that the drools endpoint doesn't get a response from any of the
> binding component.
>
>
>
>
>
> Gert Vanthienen wrote:
>
>> L.S.,
>>
>> That would be because the InOut message exchange never gets back to the
>> drools endpoint. What are you sending it to? Is it possible that the
>> target component somehow fails to send the correct response back?
>>
>> Regards,
>>
>> Gert
>>
>> gigeril wrote:
>>
>>> If I send my 23 Message and then look into servicemix with jconsole I see
>>> 16
>>> drools Threads are waiting for exchange:
>>>
>>> Name: pool-flow.seda.servicemix-drools-thread-1
>>> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
>>> Total blocked: 0 Total waited: 2
>>>
>>> Stack trace:
>>> java.lang.Object.wait(Native Method)
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>> - locked org.drools.common.DefaultAgenda@273cef
>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>> java.lang.Thread.run(Thread.java:619)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> gigeril wrote:
>>>
>>>
>>>> But if it is going back trough the drools endpoint why is the sendsync
>>>> thread in the drools endpoint still opened ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>
>>>>
>>>>> L.S.,
>>>>>
>>>>> It is going back through the Drools component. If you look at the
>>>>> JBIHelper, you'll find code like this:
>>>>> getChannel().sendSync(newMe);
>>>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>>>> me.setStatus(ExchangeStatus.DONE);
>>>>> getChannel().send(me);
>>>>> ...
>>>>>
>>>>> In the snippet above, the newMe is the Exchange being sent from the the
>>>>> Drools helper. After it returns (using sendSync), the exchange that
>>>>> came into the drools endpoint is being answered (just with DONE here,
>>>>> but there are other paths the code that return message content and
>>>>> faults).
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> gigeril wrote:
>>>>>
>>>>>
>>>>>> I don't unterstand the message flow trough servicemix when using
>>>>>> drools
>>>>>> component. If I am sending a request (INOUT Pattern), and this request
>>>>>> passes the drools endpoint and get forwarded to the TCP or HTTP
>>>>>> Endpoint
>>>>>> how
>>>>>> does the response get back to my client? Over the drools endpoint or
>>>>>> does
>>>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>>>
>>>>>> I think that it sends it directly but the drools endpoint also waits
>>>>>> for
>>>>>> the
>>>>>> response and so it is waiting and waiting and no sendSync answer is
>>>>>> send
>>>>>> to
>>>>>> it because it was already send to the consumer Endpoint.
>>>>>>
>>>>>> I ask this, because I always get the right response to my client.
>>>>>>
>>>>>> What can I do avoid this issue?
>>>>>>
>>>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Gert Vanthienen wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Andrea,
>>>>>>>
>>>>>>> Actually, I was just looking at applying that. If the code in your
>>>>>>> last
>>>>>>> comment goes into the routeTo method, isn't this a step back from
>>>>>>> where
>>>>>>> we were? It uses send() instead of sendSync(), but I no longer see
>>>>>>> any
>>>>>>> possibility of handling an InOut or RobustInOnly with a Fault
>>>>>>> message,
>>>>>>> or am I missing something there?
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Gert
>>>>>>>
>>>>>>> Andrea Zoppello wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>>
>>>>>>>> Andrea
>>>>>>>> gigeril ha scritto:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi @ all.
>>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>>>>
>>>>>>>>> |____>HTTP
>>>>>>>>> BC -->
>>>>>>>>> HTTP Server
>>>>>>>>>
>>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>>>>>> or
>>>>>>>>> the
>>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>>>> Then
>>>>>>>>> I only
>>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>>>> STRG+C in
>>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>>> Messages.
>>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>>> defined in
>>>>>>>>> my .drl where it depends on the message content if it is send to
>>>>>>>>> the
>>>>>>>>> tcp or
>>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>>
>>>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>>>> printed out
>>>>>>>>> 23 times.
>>>>>>>>>
>>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>>> assembly:
>>>>>>>>> droolsrouter-sa
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> droolsrouter-su
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> httpprovider-su
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> tcpconsumer-su
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> tcpprovider-su
>>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>>> (ServiceMix) stopped
>>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>>>> InOut[
>>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>>> status: Active
>>>>>>>>> role: provider
>>>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>>>> endpoint: myRouter
>>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>>>> not
>>>>>>>>> allowed in trailing section.
>>>>>>>>> ]
>>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>>
>>>>>>>>> )
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>>
>>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>>
>>>>>>>>> oker.java:20)
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>> ... 16 more
>>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>>
>>>>>>>>> ... 23 more
>>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>>> status to
>>>>>>>>> ERROR
>>>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>>>> to set
>>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>>
>>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>>
>>>>>>>>> )
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>>
>>>>>>>>> ... 8 more
>>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>>
>>>>>>>>> oker.java:20)
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>> ... 16 more
>>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>>
>>>>>>>>> ... 23 more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> So my rule.drl looks like:
>>>>>>>>>
>>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>>
>>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>>
>>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> rule "tcphttp:http"
>>>>>>>>> when
>>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>>> null
>>>>>>>>> );
>>>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>>> then
>>>>>>>>>
>>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>>> ");
>>>>>>>>> jbi.route(
>>>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>>>> );
>>>>>>>>> end
>>>>>>>>>
>>>>>>>>> rule "tcphttp:tcp"
>>>>>>>>> when
>>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>>> null
>>>>>>>>> );
>>>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>>> then
>>>>>>>>>
>>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>>> ");
>>>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>>>> );
>>>>>>>>> end
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>>
>>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>>
>>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>>> endpoint="myRouter"
>>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>>> <drools:namespaces>
>>>>>>>>> <drools:namespace
>>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>>> </drools:namespaces>
>>>>>>>>> </drools:namespace-context>
>>>>>>>>>
>>>>>>>>> </beans>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> -----
>>>>>>> ---
>>>>>>> Gert Vanthienen
>>>>>>> http://www.anova.be
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://www.anova.be
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>> -----
>> ---
>> Gert Vanthienen
>> http://www.anova.be
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by gigeril <ma...@knapp.com>.
But why should it not come back to the drools endpoint?? It gets back to my
client!! To define it a little bit cleaner:
TCP Client sends the Message <message
type=\"tcp\"><text>hallo</text></message>
The TCP BC takes it and route the message to the TCP Provider Endpoint
because the value of the property "type" is tcp. Then the TCP Provider
Component takes it and sends it to the TCP Server. The TCP Server takes the
"hallo" out of the message, replace it with "blaaba" and sends it back. Then
I print the response that the client gets and I see the correct message
<message type=\"tcp\"><text>blaaba</text></message>.
So the whole message flow works but only for 23 Messages. I can'T follow you
if you say that the drools endpoint doesn't get a response from any of the
binding component.
Gert Vanthienen wrote:
>
> L.S.,
>
> That would be because the InOut message exchange never gets back to the
> drools endpoint. What are you sending it to? Is it possible that the
> target component somehow fails to send the correct response back?
>
> Regards,
>
> Gert
>
> gigeril wrote:
>> If I send my 23 Message and then look into servicemix with jconsole I see
>> 16
>> drools Threads are waiting for exchange:
>>
>> Name: pool-flow.seda.servicemix-drools-thread-1
>> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
>> Total blocked: 0 Total waited: 2
>>
>> Stack trace:
>> java.lang.Object.wait(Native Method)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>> - locked org.drools.common.DefaultAgenda@273cef
>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> java.lang.Thread.run(Thread.java:619)
>>
>>
>>
>>
>>
>>
>>
>>
>> gigeril wrote:
>>
>>> But if it is going back trough the drools endpoint why is the sendsync
>>> thread in the drools endpoint still opened ?
>>>
>>>
>>>
>>>
>>>
>>> Gert Vanthienen wrote:
>>>
>>>> L.S.,
>>>>
>>>> It is going back through the Drools component. If you look at the
>>>> JBIHelper, you'll find code like this:
>>>> getChannel().sendSync(newMe);
>>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>>> me.setStatus(ExchangeStatus.DONE);
>>>> getChannel().send(me);
>>>> ...
>>>>
>>>> In the snippet above, the newMe is the Exchange being sent from the the
>>>> Drools helper. After it returns (using sendSync), the exchange that
>>>> came into the drools endpoint is being answered (just with DONE here,
>>>> but there are other paths the code that return message content and
>>>> faults).
>>>>
>>>> Regards,
>>>>
>>>> Gert
>>>>
>>>> gigeril wrote:
>>>>
>>>>> I don't unterstand the message flow trough servicemix when using
>>>>> drools
>>>>> component. If I am sending a request (INOUT Pattern), and this request
>>>>> passes the drools endpoint and get forwarded to the TCP or HTTP
>>>>> Endpoint
>>>>> how
>>>>> does the response get back to my client? Over the drools endpoint or
>>>>> does
>>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>>
>>>>> I think that it sends it directly but the drools endpoint also waits
>>>>> for
>>>>> the
>>>>> response and so it is waiting and waiting and no sendSync answer is
>>>>> send
>>>>> to
>>>>> it because it was already send to the consumer Endpoint.
>>>>>
>>>>> I ask this, because I always get the right response to my client.
>>>>>
>>>>> What can I do avoid this issue?
>>>>>
>>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Gert Vanthienen wrote:
>>>>>
>>>>>
>>>>>> Andrea,
>>>>>>
>>>>>> Actually, I was just looking at applying that. If the code in your
>>>>>> last
>>>>>> comment goes into the routeTo method, isn't this a step back from
>>>>>> where
>>>>>> we were? It uses send() instead of sendSync(), but I no longer see
>>>>>> any
>>>>>> possibility of handling an InOut or RobustInOnly with a Fault
>>>>>> message,
>>>>>> or am I missing something there?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert
>>>>>>
>>>>>> Andrea Zoppello wrote:
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>
>>>>>>> Andrea
>>>>>>> gigeril ha scritto:
>>>>>>>
>>>>>>>
>>>>>>>> Hi @ all.
>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>
>>>>>>>>
>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>>>
>>>>>>>> |____>HTTP
>>>>>>>> BC -->
>>>>>>>> HTTP Server
>>>>>>>>
>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC
>>>>>>>> or
>>>>>>>> the
>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>>> Then
>>>>>>>> I only
>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>>> STRG+C in
>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>> Messages.
>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>> defined in
>>>>>>>> my .drl where it depends on the message content if it is send to
>>>>>>>> the
>>>>>>>> tcp or
>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>
>>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>>> printed out
>>>>>>>> 23 times.
>>>>>>>>
>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>> assembly:
>>>>>>>> droolsrouter-sa
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> droolsrouter-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> httpprovider-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> tcpconsumer-su
>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>> unit:
>>>>>>>> tcpprovider-su
>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>> (ServiceMix) stopped
>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>>> InOut[
>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>> status: Active
>>>>>>>> role: provider
>>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>>> endpoint: myRouter
>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>>> not
>>>>>>>> allowed in trailing section.
>>>>>>>> ]
>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>> ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>> status to
>>>>>>>> ERROR
>>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>>> to set
>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>
>>>>>>>> at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>
>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>
>>>>>>>> )
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>
>>>>>>>> ... 8 more
>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>> java.lang.InterruptedException
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>
>>>>>>>> oker.java:20)
>>>>>>>> at
>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>> ... 16 more
>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>
>>>>>>>> ... 23 more
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> So my rule.drl looks like:
>>>>>>>>
>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>
>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>
>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>
>>>>>>>>
>>>>>>>> rule "tcphttp:http"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>> null
>>>>>>>> );
>>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route(
>>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>>> );
>>>>>>>> end
>>>>>>>>
>>>>>>>> rule "tcphttp:tcp"
>>>>>>>> when
>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>> null
>>>>>>>> );
>>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>> then
>>>>>>>>
>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>> ");
>>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>>> );
>>>>>>>> end
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>
>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>
>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>> endpoint="myRouter"
>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>
>>>>>>>>
>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>> <drools:namespaces>
>>>>>>>> <drools:namespace
>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>> </drools:namespaces>
>>>>>>>> </drools:namespace-context>
>>>>>>>>
>>>>>>>> </beans>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> -----
>>>>>> ---
>>>>>> Gert Vanthienen
>>>>>> http://www.anova.be
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> -----
>>>> ---
>>>> Gert Vanthienen
>>>> http://www.anova.be
>>>>
>>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18846821.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
That would be because the InOut message exchange never gets back to the
drools endpoint. What are you sending it to? Is it possible that the
target component somehow fails to send the correct response back?
Regards,
Gert
gigeril wrote:
> If I send my 23 Message and then look into servicemix with jconsole I see 16
> drools Threads are waiting for exchange:
>
> Name: pool-flow.seda.servicemix-drools-thread-1
> State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
> Total blocked: 0 Total waited: 2
>
> Stack trace:
> java.lang.Object.wait(Native Method)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> - locked org.drools.common.DefaultAgenda@273cef
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> - locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> java.lang.Thread.run(Thread.java:619)
>
>
>
>
>
>
>
>
> gigeril wrote:
>
>> But if it is going back trough the drools endpoint why is the sendsync
>> thread in the drools endpoint still opened ?
>>
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> It is going back through the Drools component. If you look at the
>>> JBIHelper, you'll find code like this:
>>> getChannel().sendSync(newMe);
>>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>>> me.setStatus(ExchangeStatus.DONE);
>>> getChannel().send(me);
>>> ...
>>>
>>> In the snippet above, the newMe is the Exchange being sent from the the
>>> Drools helper. After it returns (using sendSync), the exchange that
>>> came into the drools endpoint is being answered (just with DONE here,
>>> but there are other paths the code that return message content and
>>> faults).
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> gigeril wrote:
>>>
>>>> I don't unterstand the message flow trough servicemix when using drools
>>>> component. If I am sending a request (INOUT Pattern), and this request
>>>> passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint
>>>> how
>>>> does the response get back to my client? Over the drools endpoint or
>>>> does
>>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>>
>>>> I think that it sends it directly but the drools endpoint also waits for
>>>> the
>>>> response and so it is waiting and waiting and no sendSync answer is send
>>>> to
>>>> it because it was already send to the consumer Endpoint.
>>>>
>>>> I ask this, because I always get the right response to my client.
>>>>
>>>> What can I do avoid this issue?
>>>>
>>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>
>>>>
>>>>> Andrea,
>>>>>
>>>>> Actually, I was just looking at applying that. If the code in your
>>>>> last
>>>>> comment goes into the routeTo method, isn't this a step back from where
>>>>> we were? It uses send() instead of sendSync(), but I no longer see any
>>>>> possibility of handling an InOut or RobustInOnly with a Fault message,
>>>>> or am I missing something there?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> Andrea Zoppello wrote:
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I had the same problem, take a look to mine last comment on
>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>
>>>>>> Andrea
>>>>>> gigeril ha scritto:
>>>>>>
>>>>>>
>>>>>>> Hi @ all.
>>>>>>> I've following following setup of Servicemix:
>>>>>>>
>>>>>>>
>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>>> |____>HTTP
>>>>>>> BC -->
>>>>>>> HTTP Server
>>>>>>>
>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>>>>>> the
>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>> I get a problem if the drools engine get into the message chain. Then
>>>>>>> I only
>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>>> STRG+C in
>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>> Messages.
>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>> defined in
>>>>>>> my .drl where it depends on the message content if it is send to the
>>>>>>> tcp or
>>>>>>> the http server. I also get the response back to the client.
>>>>>>>
>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>> printed out
>>>>>>> 23 times.
>>>>>>>
>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>> assembly:
>>>>>>> droolsrouter-sa
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> droolsrouter-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> httpprovider-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpconsumer-su
>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>>> tcpprovider-su
>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>> (ServiceMix) stopped
>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>>> InOut[
>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>> status: Active
>>>>>>> role: provider
>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>> endpoint: myRouter
>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>> type="http"><text>hallo</text></message>
>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>>> not
>>>>>>> allowed in trailing section.
>>>>>>> ]
>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>> status to
>>>>>>> ERROR
>>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>>> to set
>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>
>>>>>>> at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>
>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>
>>>>>>> )
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>
>>>>>>> at
>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>
>>>>>>> ... 8 more
>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>> java.lang.InterruptedException
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>
>>>>>>> oker.java:20)
>>>>>>> at
>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>> ... 16 more
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>
>>>>>>> at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>
>>>>>>> ... 23 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So my rule.drl looks like:
>>>>>>>
>>>>>>> package org.apache.servicemix.drools
>>>>>>>
>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>
>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>
>>>>>>>
>>>>>>> rule "tcphttp:http"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> );
>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>>> );
>>>>>>> end
>>>>>>>
>>>>>>> rule "tcphttp:tcp"
>>>>>>> when
>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>>> );
>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>> then
>>>>>>>
>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>> ");
>>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>>> );
>>>>>>> end
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> My xbean.xml for the drools su:
>>>>>>>
>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>> http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>
>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>> endpoint="myRouter"
>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>> namespaceContext="#nsContext" />
>>>>>>>
>>>>>>>
>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>> <drools:namespaces>
>>>>>>> <drools:namespace
>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>> </drools:namespaces>
>>>>>>> </drools:namespace-context>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://www.anova.be
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by gigeril <ma...@knapp.com>.
If I send my 23 Message and then look into servicemix with jconsole I see 16
drools Threads are waiting for exchange:
Name: pool-flow.seda.servicemix-drools-thread-1
State: WAITING on org.apache.servicemix.jbi.messaging.InOutImpl@1c33b55
Total blocked: 0 Total waited: 2
Stack trace:
java.lang.Object.wait(Native Method)
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInvoker.java:20)
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
- locked org.drools.common.DefaultAgenda@273cef
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
- locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
- locked org.drools.reteoo.ReteooStatefulSession@18eb7e0
org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
java.lang.Thread.run(Thread.java:619)
gigeril wrote:
>
> But if it is going back trough the drools endpoint why is the sendsync
> thread in the drools endpoint still opened ?
>
>
>
>
>
> Gert Vanthienen wrote:
>>
>> L.S.,
>>
>> It is going back through the Drools component. If you look at the
>> JBIHelper, you'll find code like this:
>> getChannel().sendSync(newMe);
>> if (newMe.getStatus() == ExchangeStatus.DONE) {
>> me.setStatus(ExchangeStatus.DONE);
>> getChannel().send(me);
>> ...
>>
>> In the snippet above, the newMe is the Exchange being sent from the the
>> Drools helper. After it returns (using sendSync), the exchange that
>> came into the drools endpoint is being answered (just with DONE here,
>> but there are other paths the code that return message content and
>> faults).
>>
>> Regards,
>>
>> Gert
>>
>> gigeril wrote:
>>> I don't unterstand the message flow trough servicemix when using drools
>>> component. If I am sending a request (INOUT Pattern), and this request
>>> passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint
>>> how
>>> does the response get back to my client? Over the drools endpoint or
>>> does
>>> the http/tcp endpoint send it to the tcp consumer directly??
>>>
>>> I think that it sends it directly but the drools endpoint also waits for
>>> the
>>> response and so it is waiting and waiting and no sendSync answer is send
>>> to
>>> it because it was already send to the consumer Endpoint.
>>>
>>> I ask this, because I always get the right response to my client.
>>>
>>> What can I do avoid this issue?
>>>
>>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>>
>>>
>>>
>>>
>>>
>>> Gert Vanthienen wrote:
>>>
>>>> Andrea,
>>>>
>>>> Actually, I was just looking at applying that. If the code in your
>>>> last
>>>> comment goes into the routeTo method, isn't this a step back from where
>>>> we were? It uses send() instead of sendSync(), but I no longer see any
>>>> possibility of handling an InOut or RobustInOnly with a Fault message,
>>>> or am I missing something there?
>>>>
>>>> Regards,
>>>>
>>>> Gert
>>>>
>>>> Andrea Zoppello wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I had the same problem, take a look to mine last comment on
>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>
>>>>> Andrea
>>>>> gigeril ha scritto:
>>>>>
>>>>>> Hi @ all.
>>>>>> I've following following setup of Servicemix:
>>>>>>
>>>>>>
>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>>> |____>HTTP
>>>>>> BC -->
>>>>>> HTTP Server
>>>>>>
>>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>>>>> the
>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>> I get a problem if the drools engine get into the message chain. Then
>>>>>> I only
>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>>> connection timeout and the connectors get stuck. I can only press
>>>>>> STRG+C in
>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>> Messages.
>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>> defined in
>>>>>> my .drl where it depends on the message content if it is send to the
>>>>>> tcp or
>>>>>> the http server. I also get the response back to the client.
>>>>>>
>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>> printed out
>>>>>> 23 times.
>>>>>>
>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>> assembly:
>>>>>> droolsrouter-sa
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> droolsrouter-su
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> httpprovider-su
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> tcpconsumer-su
>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>>> tcpprovider-su
>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>> (ServiceMix) stopped
>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>>> InOut[
>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>> status: Active
>>>>>> role: provider
>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>> endpoint: myRouter
>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>> type="http"><text>hallo</text></message>
>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>>> not
>>>>>> allowed in trailing section.
>>>>>> ]
>>>>>> org.drools.spi.ConsequenceException:
>>>>>> javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>
>>>>>> )
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>
>>>>>> oker.java:20)
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>> ... 16 more
>>>>>> Caused by: java.lang.InterruptedException
>>>>>> at java.lang.Object.wait(Native Method)
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>
>>>>>> ... 23 more
>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>> status to
>>>>>> ERROR
>>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>>> to set
>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>
>>>>>> at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>
>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>> javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>
>>>>>> )
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>
>>>>>> at
>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>
>>>>>> ... 8 more
>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>> java.lang.InterruptedException
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>> at
>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>
>>>>>> oker.java:20)
>>>>>> at
>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>> ... 16 more
>>>>>> Caused by: java.lang.InterruptedException
>>>>>> at java.lang.Object.wait(Native Method)
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>
>>>>>> at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>
>>>>>> ... 23 more
>>>>>>
>>>>>>
>>>>>>
>>>>>> So my rule.drl looks like:
>>>>>>
>>>>>> package org.apache.servicemix.drools
>>>>>>
>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>
>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>
>>>>>>
>>>>>> rule "tcphttp:http"
>>>>>> when
>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>> );
>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>> then
>>>>>>
>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>> ");
>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>>> );
>>>>>> end
>>>>>>
>>>>>> rule "tcphttp:tcp"
>>>>>> when
>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>>> );
>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>> then
>>>>>>
>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>> ");
>>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider"
>>>>>> );
>>>>>> end
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> My xbean.xml for the drools su:
>>>>>>
>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>> http://www.springframework.org/schema/beans
>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>
>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>> endpoint="myRouter"
>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>> namespaceContext="#nsContext" />
>>>>>>
>>>>>>
>>>>>> <drools:namespace-context id="nsContext">
>>>>>> <drools:namespaces>
>>>>>> <drools:namespace
>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>> </drools:namespaces>
>>>>>> </drools:namespace-context>
>>>>>>
>>>>>> </beans>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> -----
>>>> ---
>>>> Gert Vanthienen
>>>> http://www.anova.be
>>>>
>>>>
>>>
>>>
>>
>>
>>
>> -----
>> ---
>> Gert Vanthienen
>> http://www.anova.be
>>
>
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18846520.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by gigeril <ma...@knapp.com>.
But if it is going back trough the drools endpoint why is the sendsync thread
in the drools endpoint still opened ?
Gert Vanthienen wrote:
>
> L.S.,
>
> It is going back through the Drools component. If you look at the
> JBIHelper, you'll find code like this:
> getChannel().sendSync(newMe);
> if (newMe.getStatus() == ExchangeStatus.DONE) {
> me.setStatus(ExchangeStatus.DONE);
> getChannel().send(me);
> ...
>
> In the snippet above, the newMe is the Exchange being sent from the the
> Drools helper. After it returns (using sendSync), the exchange that
> came into the drools endpoint is being answered (just with DONE here,
> but there are other paths the code that return message content and
> faults).
>
> Regards,
>
> Gert
>
> gigeril wrote:
>> I don't unterstand the message flow trough servicemix when using drools
>> component. If I am sending a request (INOUT Pattern), and this request
>> passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint
>> how
>> does the response get back to my client? Over the drools endpoint or does
>> the http/tcp endpoint send it to the tcp consumer directly??
>>
>> I think that it sends it directly but the drools endpoint also waits for
>> the
>> response and so it is waiting and waiting and no sendSync answer is send
>> to
>> it because it was already send to the consumer Endpoint.
>>
>> I ask this, because I always get the right response to my client.
>>
>> What can I do avoid this issue?
>>
>> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>>
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> Andrea,
>>>
>>> Actually, I was just looking at applying that. If the code in your last
>>> comment goes into the routeTo method, isn't this a step back from where
>>> we were? It uses send() instead of sendSync(), but I no longer see any
>>> possibility of handling an InOut or RobustInOnly with a Fault message,
>>> or am I missing something there?
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> Andrea Zoppello wrote:
>>>
>>>> Hi,
>>>>
>>>> I had the same problem, take a look to mine last comment on
>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>
>>>> Andrea
>>>> gigeril ha scritto:
>>>>
>>>>> Hi @ all.
>>>>> I've following following setup of Servicemix:
>>>>>
>>>>>
>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>>> |____>HTTP
>>>>> BC -->
>>>>> HTTP Server
>>>>>
>>>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>>>> the
>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>> I get a problem if the drools engine get into the message chain. Then
>>>>> I only
>>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>>> connection timeout and the connectors get stuck. I can only press
>>>>> STRG+C in
>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>> Messages.
>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>> defined in
>>>>> my .drl where it depends on the message content if it is send to the
>>>>> tcp or
>>>>> the http server. I also get the response back to the client.
>>>>>
>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>> printed out
>>>>> 23 times.
>>>>>
>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>> assembly:
>>>>> droolsrouter-sa
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> droolsrouter-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> httpprovider-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> tcpconsumer-su
>>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>>> tcpprovider-su
>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>> (ServiceMix) stopped
>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>> ERROR - DroolsComponent - Error processing exchange
>>>>> InOut[
>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>> status: Active
>>>>> role: provider
>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>> endpoint: myRouter
>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>> type="http"><text>hallo</text></message>
>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is
>>>>> not
>>>>> allowed in trailing section.
>>>>> ]
>>>>> org.drools.spi.ConsequenceException:
>>>>> javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>
>>>>> )
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>
>>>>> oker.java:20)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>> ... 16 more
>>>>> Caused by: java.lang.InterruptedException
>>>>> at java.lang.Object.wait(Native Method)
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>
>>>>> ... 23 more
>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>> status to
>>>>> ERROR
>>>>> java.lang.IllegalStateException: component is not owner when trying
>>>>> to set
>>>>> error: org.drools.spi.ConsequenceException: j
>>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>
>>>>> at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>>> at
>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>
>>>>> )
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>
>>>>> ... 8 more
>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>> java.lang.InterruptedException
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>> at
>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>
>>>>> oker.java:20)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>> ... 16 more
>>>>> Caused by: java.lang.InterruptedException
>>>>> at java.lang.Object.wait(Native Method)
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>
>>>>> ... 23 more
>>>>>
>>>>>
>>>>>
>>>>> So my rule.drl looks like:
>>>>>
>>>>> package org.apache.servicemix.drools
>>>>>
>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>
>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>
>>>>>
>>>>> rule "tcphttp:http"
>>>>> when
>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>> );
>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>> then
>>>>>
>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>> ");
>>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider"
>>>>> );
>>>>> end
>>>>>
>>>>> rule "tcphttp:tcp"
>>>>> when
>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null
>>>>> );
>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>> then
>>>>>
>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>> end
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> My xbean.xml for the drools su:
>>>>>
>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>> http://www.springframework.org/schema/beans
>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>
>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>> endpoint="myRouter"
>>>>> ruleBaseResource="classpath:rule.drl"
>>>>> namespaceContext="#nsContext" />
>>>>>
>>>>>
>>>>> <drools:namespace-context id="nsContext">
>>>>> <drools:namespaces>
>>>>> <drools:namespace
>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>> </drools:namespaces>
>>>>> </drools:namespace-context>
>>>>>
>>>>> </beans>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18846446.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
It is going back through the Drools component. If you look at the
JBIHelper, you'll find code like this:
getChannel().sendSync(newMe);
if (newMe.getStatus() == ExchangeStatus.DONE) {
me.setStatus(ExchangeStatus.DONE);
getChannel().send(me);
...
In the snippet above, the newMe is the Exchange being sent from the the
Drools helper. After it returns (using sendSync), the exchange that
came into the drools endpoint is being answered (just with DONE here,
but there are other paths the code that return message content and
faults).
Regards,
Gert
gigeril wrote:
> I don't unterstand the message flow trough servicemix when using drools
> component. If I am sending a request (INOUT Pattern), and this request
> passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint how
> does the response get back to my client? Over the drools endpoint or does
> the http/tcp endpoint send it to the tcp consumer directly??
>
> I think that it sends it directly but the drools endpoint also waits for the
> response and so it is waiting and waiting and no sendSync answer is send to
> it because it was already send to the consumer Endpoint.
>
> I ask this, because I always get the right response to my client.
>
> What can I do avoid this issue?
>
> btw.: I am using apache-servicemix-3.3-20080721.213539-7.
>
>
>
>
>
> Gert Vanthienen wrote:
>
>> Andrea,
>>
>> Actually, I was just looking at applying that. If the code in your last
>> comment goes into the routeTo method, isn't this a step back from where
>> we were? It uses send() instead of sendSync(), but I no longer see any
>> possibility of handling an InOut or RobustInOnly with a Fault message,
>> or am I missing something there?
>>
>> Regards,
>>
>> Gert
>>
>> Andrea Zoppello wrote:
>>
>>> Hi,
>>>
>>> I had the same problem, take a look to mine last comment on
>>> https://issues.apache.org/activemq/browse/SM-1248
>>>
>>> Andrea
>>> gigeril ha scritto:
>>>
>>>> Hi @ all.
>>>> I've following following setup of Servicemix:
>>>>
>>>>
>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>>> |____>HTTP
>>>> BC -->
>>>> HTTP Server
>>>>
>>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>>> the
>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>> I get a problem if the drools engine get into the message chain. Then
>>>> I only
>>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>>> connection timeout and the connectors get stuck. I can only press
>>>> STRG+C in
>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>> Messages.
>>>> This sending of this 23 Messages work fine. They take the way I
>>>> defined in
>>>> my .drl where it depends on the message content if it is send to the
>>>> tcp or
>>>> the http server. I also get the response back to the client.
>>>>
>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>> printed out
>>>> 23 times.
>>>>
>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
>>>> droolsrouter-sa
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> droolsrouter-su
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> httpprovider-su
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> tcpconsumer-su
>>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>>> tcpprovider-su
>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>> (ServiceMix) stopped
>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>> ERROR - DroolsComponent - Error processing exchange
>>>> InOut[
>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>> status: Active
>>>> role: provider
>>>> service: {http://knapp.com/tcphttp}myRouter
>>>> endpoint: myRouter
>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>> type="http"><text>hallo</text></message>
>>>> out: Unable to display: org.xml.sax.SAXParseException: Content is not
>>>> allowed in trailing section.
>>>> ]
>>>> org.drools.spi.ConsequenceException:
>>>> javax.jbi.messaging.MessagingException:
>>>> java.lang.InterruptedException
>>>> at
>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>
>>>> )
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>
>>>> at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>> java.lang.InterruptedException
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>
>>>> at
>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>
>>>> oker.java:20)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>> ... 16 more
>>>> Caused by: java.lang.InterruptedException
>>>> at java.lang.Object.wait(Native Method)
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>
>>>> ... 23 more
>>>> ERROR - DroolsComponent - Error setting exchange
>>>> status to
>>>> ERROR
>>>> java.lang.IllegalStateException: component is not owner when trying
>>>> to set
>>>> error: org.drools.spi.ConsequenceException: j
>>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>> at
>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>
>>>> at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>
>>>> at java.lang.Thread.run(Thread.java:619)
>>>> Caused by: org.drools.spi.ConsequenceException:
>>>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>>> at
>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>
>>>> )
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>
>>>> at
>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>
>>>> ... 8 more
>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>> java.lang.InterruptedException
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>
>>>> at
>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>> at
>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>
>>>> at
>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>
>>>> oker.java:20)
>>>> at
>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>> ... 16 more
>>>> Caused by: java.lang.InterruptedException
>>>> at java.lang.Object.wait(Native Method)
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>
>>>> ... 23 more
>>>>
>>>>
>>>>
>>>> So my rule.drl looks like:
>>>>
>>>> package org.apache.servicemix.drools
>>>>
>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>
>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>
>>>>
>>>> rule "tcphttp:http"
>>>> when
>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>> then
>>>>
>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
>>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>> end
>>>>
>>>> rule "tcphttp:tcp"
>>>> when
>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>> then
>>>>
>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>> end
>>>>
>>>>
>>>>
>>>>
>>>> My xbean.xml for the drools su:
>>>>
>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>> xmlns="http://www.springframework.org/schema/beans"
>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>> http://www.springframework.org/schema/beans
>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>
>>>> <drools:endpoint service="tcphttp:myRouter"
>>>> endpoint="myRouter"
>>>> ruleBaseResource="classpath:rule.drl"
>>>> namespaceContext="#nsContext" />
>>>>
>>>>
>>>> <drools:namespace-context id="nsContext">
>>>> <drools:namespaces>
>>>> <drools:namespace
>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>> </drools:namespaces>
>>>> </drools:namespace-context>
>>>>
>>>> </beans>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>> -----
>> ---
>> Gert Vanthienen
>> http://www.anova.be
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by gigeril <ma...@knapp.com>.
I don't unterstand the message flow trough servicemix when using drools
component. If I am sending a request (INOUT Pattern), and this request
passes the drools endpoint and get forwarded to the TCP or HTTP Endpoint how
does the response get back to my client? Over the drools endpoint or does
the http/tcp endpoint send it to the tcp consumer directly??
I think that it sends it directly but the drools endpoint also waits for the
response and so it is waiting and waiting and no sendSync answer is send to
it because it was already send to the consumer Endpoint.
I ask this, because I always get the right response to my client.
What can I do avoid this issue?
btw.: I am using apache-servicemix-3.3-20080721.213539-7.
Gert Vanthienen wrote:
>
> Andrea,
>
> Actually, I was just looking at applying that. If the code in your last
> comment goes into the routeTo method, isn't this a step back from where
> we were? It uses send() instead of sendSync(), but I no longer see any
> possibility of handling an InOut or RobustInOnly with a Fault message,
> or am I missing something there?
>
> Regards,
>
> Gert
>
> Andrea Zoppello wrote:
>> Hi,
>>
>> I had the same problem, take a look to mine last comment on
>> https://issues.apache.org/activemq/browse/SM-1248
>>
>> Andrea
>> gigeril ha scritto:
>>> Hi @ all.
>>> I've following following setup of Servicemix:
>>>
>>>
>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>>> |____>HTTP
>>> BC -->
>>> HTTP Server
>>>
>>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>>> the
>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>> I get a problem if the drools engine get into the message chain. Then
>>> I only
>>> can send 23 Messages (always 23!!) until my tcp client reports me a
>>> connection timeout and the connectors get stuck. I can only press
>>> STRG+C in
>>> the Servicemix Console Window to restart Servicemix and send 23
>>> Messages.
>>> This sending of this 23 Messages work fine. They take the way I
>>> defined in
>>> my .drl where it depends on the message content if it is send to the
>>> tcp or
>>> the http server. I also get the response back to the client.
>>>
>>> This is the output when I press STRG+C. This whole stacktrace is
>>> printed out
>>> 23 times.
>>>
>>> INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
>>> droolsrouter-sa
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> droolsrouter-su
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> httpprovider-su
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> tcpconsumer-su
>>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>>> tcpprovider-su
>>> INFO - JBIContainer - ServiceMix JBI Container
>>> (ServiceMix) stopped
>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>> ERROR - DroolsComponent - Error processing exchange
>>> InOut[
>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>> status: Active
>>> role: provider
>>> service: {http://knapp.com/tcphttp}myRouter
>>> endpoint: myRouter
>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>> type="http"><text>hallo</text></message>
>>> out: Unable to display: org.xml.sax.SAXParseException: Content is not
>>> allowed in trailing section.
>>> ]
>>> org.drools.spi.ConsequenceException:
>>> javax.jbi.messaging.MessagingException:
>>> java.lang.InterruptedException
>>> at
>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>
>>> )
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>> at
>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>
>>> at
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: javax.jbi.messaging.MessagingException:
>>> java.lang.InterruptedException
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>
>>> at
>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>
>>> oker.java:20)
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>> ... 16 more
>>> Caused by: java.lang.InterruptedException
>>> at java.lang.Object.wait(Native Method)
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>
>>> ... 23 more
>>> ERROR - DroolsComponent - Error setting exchange
>>> status to
>>> ERROR
>>> java.lang.IllegalStateException: component is not owner when trying
>>> to set
>>> error: org.drools.spi.ConsequenceException: j
>>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>> at
>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>
>>> at
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: org.drools.spi.ConsequenceException:
>>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>>> at
>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>
>>> )
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>> at
>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>
>>> at
>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>
>>> ... 8 more
>>> Caused by: javax.jbi.messaging.MessagingException:
>>> java.lang.InterruptedException
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>
>>> at
>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>> at
>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>
>>> at
>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>
>>> oker.java:20)
>>> at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>> ... 16 more
>>> Caused by: java.lang.InterruptedException
>>> at java.lang.Object.wait(Native Method)
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>
>>> ... 23 more
>>>
>>>
>>>
>>> So my rule.drl looks like:
>>>
>>> package org.apache.servicemix.drools
>>>
>>> import org.apache.servicemix.drools.model.Exchange;
>>>
>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>
>>>
>>> rule "tcphttp:http"
>>> when
>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>> then
>>>
>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
>>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
>>> end
>>>
>>> rule "tcphttp:tcp"
>>> when
>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>> then
>>>
>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>>> end
>>>
>>>
>>>
>>>
>>> My xbean.xml for the drools su:
>>>
>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>> xmlns="http://www.springframework.org/schema/beans"
>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>> http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>
>>> <drools:endpoint service="tcphttp:myRouter"
>>> endpoint="myRouter"
>>> ruleBaseResource="classpath:rule.drl"
>>> namespaceContext="#nsContext" />
>>>
>>>
>>> <drools:namespace-context id="nsContext">
>>> <drools:namespaces>
>>> <drools:namespace
>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>> </drools:namespaces>
>>> </drools:namespace-context>
>>>
>>> </beans>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18846058.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
Andrea,
Actually, I was just looking at applying that. If the code in your last
comment goes into the routeTo method, isn't this a step back from where
we were? It uses send() instead of sendSync(), but I no longer see any
possibility of handling an InOut or RobustInOnly with a Fault message,
or am I missing something there?
Regards,
Gert
Andrea Zoppello wrote:
> Hi,
>
> I had the same problem, take a look to mine last comment on
> https://issues.apache.org/activemq/browse/SM-1248
>
> Andrea
> gigeril ha scritto:
>> Hi @ all.
>> I've following following setup of Servicemix:
>>
>>
>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
>> |____>HTTP
>> BC -->
>> HTTP Server
>>
>> If I connect (target Service) my own written TCP BC to the HTTP BC or
>> the
>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>> I get a problem if the drools engine get into the message chain. Then
>> I only
>> can send 23 Messages (always 23!!) until my tcp client reports me a
>> connection timeout and the connectors get stuck. I can only press
>> STRG+C in
>> the Servicemix Console Window to restart Servicemix and send 23
>> Messages.
>> This sending of this 23 Messages work fine. They take the way I
>> defined in
>> my .drl where it depends on the message content if it is send to the
>> tcp or
>> the http server. I also get the response back to the client.
>>
>> This is the output when I press STRG+C. This whole stacktrace is
>> printed out
>> 23 times.
>>
>> INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
>> droolsrouter-sa
>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>> droolsrouter-su
>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>> httpprovider-su
>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>> tcpconsumer-su
>> INFO - ServiceUnitLifeCycle - Shutting down service unit:
>> tcpprovider-su
>> INFO - JBIContainer - ServiceMix JBI Container
>> (ServiceMix) stopped
>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>> ERROR - DroolsComponent - Error processing exchange
>> InOut[
>> id: ID:10.22.20.113-11b93600c6f-4:0
>> status: Active
>> role: provider
>> service: {http://knapp.com/tcphttp}myRouter
>> endpoint: myRouter
>> in: <?xml version="1.0" encoding="UTF-8"?><message
>> type="http"><text>hallo</text></message>
>> out: Unable to display: org.xml.sax.SAXParseException: Content is not
>> allowed in trailing section.
>> ]
>> org.drools.spi.ConsequenceException:
>> javax.jbi.messaging.MessagingException:
>> java.lang.InterruptedException
>> at
>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>
>> )
>> at
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>> at
>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>> at
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>
>> at
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>
>> at
>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>
>> at
>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>
>> at
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: javax.jbi.messaging.MessagingException:
>> java.lang.InterruptedException
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>
>> at
>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>
>> at
>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>> at
>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>> at
>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>
>> at
>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>
>> oker.java:20)
>> at
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>> ... 16 more
>> Caused by: java.lang.InterruptedException
>> at java.lang.Object.wait(Native Method)
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>
>> ... 23 more
>> ERROR - DroolsComponent - Error setting exchange
>> status to
>> ERROR
>> java.lang.IllegalStateException: component is not owner when trying
>> to set
>> error: org.drools.spi.ConsequenceException: j
>> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
>> at
>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>
>> at
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: org.drools.spi.ConsequenceException:
>> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
>> at
>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>
>> )
>> at
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>> at
>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>> at
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>
>> at
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>
>> at
>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>
>> at
>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>
>> ... 8 more
>> Caused by: javax.jbi.messaging.MessagingException:
>> java.lang.InterruptedException
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>
>> at
>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>
>> at
>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>> at
>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>> at
>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>
>> at
>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>
>> oker.java:20)
>> at
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>> ... 16 more
>> Caused by: java.lang.InterruptedException
>> at java.lang.Object.wait(Native Method)
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>
>> ... 23 more
>>
>>
>>
>> So my rule.drl looks like:
>>
>> package org.apache.servicemix.drools
>>
>> import org.apache.servicemix.drools.model.Exchange;
>>
>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>
>>
>> rule "tcphttp:http"
>> when
>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>> eval( inmsg.xpath("/message/@type = \"http\""))
>> then
>>
>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
>> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
>> end
>>
>> rule "tcphttp:tcp"
>> when
>> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>> then
>>
>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
>> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
>> end
>>
>>
>>
>>
>> My xbean.xml for the drools su:
>>
>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>> xmlns:tcphttp="http://knapp.com/tcphttp"
>> xmlns="http://www.springframework.org/schema/beans"
>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>
>> <drools:endpoint service="tcphttp:myRouter"
>> endpoint="myRouter"
>> ruleBaseResource="classpath:rule.drl"
>> namespaceContext="#nsContext" />
>>
>>
>> <drools:namespace-context id="nsContext">
>> <drools:namespaces>
>> <drools:namespace
>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>> </drools:namespaces>
>> </drools:namespace-context>
>>
>> </beans>
>>
>>
>>
>>
>>
>>
>>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Andrea Zoppello <zo...@tiscali.it>.
Hi,
I had the same problem, take a look to mine last comment on
https://issues.apache.org/activemq/browse/SM-1248
Andrea
gigeril ha scritto:
> Hi @ all.
> I've following following setup of Servicemix:
>
>
> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
> |____>HTTP BC -->
> HTTP Server
>
> If I connect (target Service) my own written TCP BC to the HTTP BC or the
> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>
> I get a problem if the drools engine get into the message chain. Then I only
> can send 23 Messages (always 23!!) until my tcp client reports me a
> connection timeout and the connectors get stuck. I can only press STRG+C in
> the Servicemix Console Window to restart Servicemix and send 23 Messages.
> This sending of this 23 Messages work fine. They take the way I defined in
> my .drl where it depends on the message content if it is send to the tcp or
> the http server. I also get the response back to the client.
>
> This is the output when I press STRG+C. This whole stacktrace is printed out
> 23 times.
>
> INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
> droolsrouter-sa
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> droolsrouter-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> httpprovider-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> tcpconsumer-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> tcpprovider-su
> INFO - JBIContainer - ServiceMix JBI Container
> (ServiceMix) stopped
> [Fatal Error] :1:89: Content is not allowed in trailing section.
> ERROR - DroolsComponent - Error processing exchange InOut[
> id: ID:10.22.20.113-11b93600c6f-4:0
> status: Active
> role: provider
> service: {http://knapp.com/tcphttp}myRouter
> endpoint: myRouter
> in: <?xml version="1.0" encoding="UTF-8"?><message
> type="http"><text>hallo</text></message>
> out: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in trailing section.
> ]
> org.drools.spi.ConsequenceException: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
> )
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> at
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> at
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> at
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> at
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> at
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
> oker.java:20)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> ... 16 more
> Caused by: java.lang.InterruptedException
> at java.lang.Object.wait(Native Method)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> ... 23 more
> ERROR - DroolsComponent - Error setting exchange status to
> ERROR
> java.lang.IllegalStateException: component is not owner when trying to set
> error: org.drools.spi.ConsequenceException: j
> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
> at
> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
> at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.drools.spi.ConsequenceException:
> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
> at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
> )
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> at
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> at
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> ... 8 more
> Caused by: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> at
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> at
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> at
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
> oker.java:20)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> ... 16 more
> Caused by: java.lang.InterruptedException
> at java.lang.Object.wait(Native Method)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> ... 23 more
>
>
>
> So my rule.drl looks like:
>
> package org.apache.servicemix.drools
>
> import org.apache.servicemix.drools.model.Exchange;
>
> global org.apache.servicemix.drools.model.JbiHelper jbi;
>
>
> rule "tcphttp:http"
> when
> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
> eval( inmsg.xpath("/message/@type = \"http\""))
> then
> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
> end
>
> rule "tcphttp:tcp"
> when
> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
> eval( inmsg.xpath("/message/@type = \"tcp\""));
> then
> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
> end
>
>
>
>
> My xbean.xml for the drools su:
>
> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
> xmlns:tcphttp="http://knapp.com/tcphttp"
> xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
> <drools:endpoint service="tcphttp:myRouter"
> endpoint="myRouter"
> ruleBaseResource="classpath:rule.drl"
> namespaceContext="#nsContext" />
>
>
> <drools:namespace-context id="nsContext">
> <drools:namespaces>
> <drools:namespace
> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
> </drools:namespaces>
> </drools:namespace-context>
>
> </beans>
>
>
>
>
>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
Could you use a JMX Console to connect to ServiceMix and check out what
the Drools and TCP/IP components threads are doing? Are they all
waiting on some sendSync()?
Regards,
Gert
gigeril wrote:
> Hi @ all.
> I've following following setup of Servicemix:
>
>
> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP Server
> |____>HTTP BC -->
> HTTP Server
>
> If I connect (target Service) my own written TCP BC to the HTTP BC or the
> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>
> I get a problem if the drools engine get into the message chain. Then I only
> can send 23 Messages (always 23!!) until my tcp client reports me a
> connection timeout and the connectors get stuck. I can only press STRG+C in
> the Servicemix Console Window to restart Servicemix and send 23 Messages.
> This sending of this 23 Messages work fine. They take the way I defined in
> my .drl where it depends on the message content if it is send to the tcp or
> the http server. I also get the response back to the client.
>
> This is the output when I press STRG+C. This whole stacktrace is printed out
> 23 times.
>
> INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
> droolsrouter-sa
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> droolsrouter-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> httpprovider-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> tcpconsumer-su
> INFO - ServiceUnitLifeCycle - Shutting down service unit:
> tcpprovider-su
> INFO - JBIContainer - ServiceMix JBI Container
> (ServiceMix) stopped
> [Fatal Error] :1:89: Content is not allowed in trailing section.
> ERROR - DroolsComponent - Error processing exchange InOut[
> id: ID:10.22.20.113-11b93600c6f-4:0
> status: Active
> role: provider
> service: {http://knapp.com/tcphttp}myRouter
> endpoint: myRouter
> in: <?xml version="1.0" encoding="UTF-8"?><message
> type="http"><text>hallo</text></message>
> out: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in trailing section.
> ]
> org.drools.spi.ConsequenceException: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
> )
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> at
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> at
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> at
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> at
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> at
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
> oker.java:20)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> ... 16 more
> Caused by: java.lang.InterruptedException
> at java.lang.Object.wait(Native Method)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> ... 23 more
> ERROR - DroolsComponent - Error setting exchange status to
> ERROR
> java.lang.IllegalStateException: component is not owner when trying to set
> error: org.drools.spi.ConsequenceException: j
> avax.jbi.messaging.MessagingException: java.lang.InterruptedException
> at
> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
> at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.drools.spi.ConsequenceException:
> javax.jbi.messaging.MessagingException: java.lang.InterruptedException
> at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
> )
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
> at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
> at
> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
> at
> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
> ... 8 more
> Caused by: javax.jbi.messaging.MessagingException:
> java.lang.InterruptedException
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
> at
> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
> at
> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
> at
> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
> at
> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
> oker.java:20)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
> ... 16 more
> Caused by: java.lang.InterruptedException
> at java.lang.Object.wait(Native Method)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
> ... 23 more
>
>
>
> So my rule.drl looks like:
>
> package org.apache.servicemix.drools
>
> import org.apache.servicemix.drools.model.Exchange;
>
> global org.apache.servicemix.drools.model.JbiHelper jbi;
>
>
> rule "tcphttp:http"
> when
> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
> eval( inmsg.xpath("/message/@type = \"http\""))
> then
> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!! ");
> jbi.route( "service:http://knapp.com/tcphttp/dhttp_provider" );
> end
>
> rule "tcphttp:tcp"
> when
> me : Exchange( status == Exchange.ACTIVE, inmsg : in != null );
> eval( inmsg.xpath("/message/@type = \"tcp\""));
> then
> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!! ");
> jbi.route( "service:http://knapp.com/tcphttp/dtcp_provider" );
> end
>
>
>
>
> My xbean.xml for the drools su:
>
> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
> xmlns:tcphttp="http://knapp.com/tcphttp"
> xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
> <drools:endpoint service="tcphttp:myRouter"
> endpoint="myRouter"
> ruleBaseResource="classpath:rule.drl"
> namespaceContext="#nsContext" />
>
>
> <drools:namespace-context id="nsContext">
> <drools:namespaces>
> <drools:namespace
> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
> </drools:namespaces>
> </drools:namespace-context>
>
> </beans>
>
>
>
>
>
>
>
Re: Drools BindingComponent get Stuck after sending 23 Messages???
Posted by rgavlin <rg...@yahoo.com>.
In this case, the smx-saxon xquery endpoint currently only supports an in-out
mep.
Andrea Zoppello-2 wrote:
>
> Why not use a process where you use the Synchronizer Spagic component or
> the smx AsyncBridge, in that case the drools the process could be ( i
> supposed here you have an HTTP InOut BC.
>
> HTTP BC (InOut) ---> AsyncBrigdge --> Drools
>
> and from here SAXON1, SAXON2
>
> Andrea
> Ron Gavlin ha scritto:
>> Hi Andrea,
>>
>> Let's say I have 5 different smx-saxon endpoints which take an in-out mep
>> and I would like to use smx-drools as a simple xpath router to determine
>> which of my 5 smx-saxon endpoints is used for the transformation. This
>> seems like a valid use case.
>>
>>
>>
>> ----- Original Message ----
>> From: Andrea Zoppello <zo...@tiscali.it>
>> To: users@servicemix.apache.org
>> Sent: Wednesday, August 6, 2008 5:18:43 AM
>> Subject: Re: Drools BindingComponent get Stuck after sending 23
>> Messages???
>>
>> Hi Gert,
>>
>> Waht about to make a route implementation so when an InOut Exchange
>> arrives it will automatically call the answer method.
>>
>> BTW i cannot figure a usecase where you need to send an InOut exchange
>> to a drools component and then rerouting this InOut exchange to another
>> endpoint.
>>
>> As i said to Lars if you need this capabilities you could use other
>> components, not drools.
>>
>> Andrea
>>
>> Andrea
>> Gert Vanthienen ha scritto:
>>
>>> Andrea,
>>>
>>> Yeah, we should definitely get asynchronous support for Drools so we
>>> need to get this done. If the route() method before was able to
>>> handle InOut exchanges, we should make sure it still does to avoid
>>> breaking people's existing code though -- how about replacing the
>>> Exception being thrown at the end by a WARN log statement saying the
>>> same thing but still handling the Exchange in a synchronous way as
>>> before? This way, we still encourage people to start using answer().
>>>
>>> Gert
>>>
>>> Andrea Zoppello wrote:
>>>
>>>> Ok Gert,
>>>>
>>>> Probably i miss to handle the error case, but except for this, i
>>>> ensure i've stressed with load test the components and it works
>>>> correcly, under heavvy load.
>>>>
>>>> My suggestion is to start from my code to handle error case, and to
>>>> commit this.
>>>>
>>>> Do you agree is better to use helper.route for (InOnly / Robust
>>>> InOnly ) and helper.answer for InOut??
>>>>
>>>> Andrea
>>>> Gert Vanthienen ha scritto:
>>>>
>>>>> Andrea,
>>>>>
>>>>> And what if the InOnly MessageExchange you forwarded ends in ERROR?
>>>>> The solution you proposed already answered the incoming exchange
>>>>> with DONE by the time you figure that out. And I think the same
>>>>> goes for RobustInOnly's fault message.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> Andrea Zoppello wrote:
>>>>>
>>>>>> Hi Gert,
>>>>>>
>>>>>> The route method in my opinion is to handle inonly or robust inonly
>>>>>> exchange, if you want to answer you could use the answer method.
>>>>>>
>>>>>> In my opinion you must choose what you want to do when you write
>>>>>> drools file.
>>>>>>
>>>>>> If you need to forward ( creating another exhange ) an InOnly
>>>>>> exchange use helper.route instead you need to use helper.answer.
>>>>>>
>>>>>> This should cover all the case.
>>>>>>
>>>>>> Andrea
>>>>>> Gert Vanthienen ha scritto:
>>>>>>
>>>>>>> Andrea,
>>>>>>>
>>>>>>> Actually, I was just looking at applying that. If the code in
>>>>>>> your last comment goes into the routeTo method, isn't this a step
>>>>>>> back from where we were? It uses send() instead of sendSync(),
>>>>>>> but I no longer see any possibility of handling an InOut or
>>>>>>> RobustInOnly with a Fault message, or am I missing something there?
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Gert
>>>>>>>
>>>>>>> Andrea Zoppello wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I had the same problem, take a look to mine last comment on
>>>>>>>> https://issues.apache.org/activemq/browse/SM-1248
>>>>>>>>
>>>>>>>> Andrea
>>>>>>>> gigeril ha scritto:
>>>>>>>>
>>>>>>>>> Hi @ all.
>>>>>>>>> I've following following setup of Servicemix:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> TCP Client -----> TCP BC-->drools BC ------> TCP BC ---> TCP
>>>>>>>>> Server
>>>>>>>>>
>>>>>>>>> |____>HTTP BC -->
>>>>>>>>> HTTP Server
>>>>>>>>>
>>>>>>>>> If I connect (target Service) my own written TCP BC to the HTTP
>>>>>>>>> BC or the
>>>>>>>>> TCP BC it works fine (sync, async, Pattern: Inout, InOnly).
>>>>>>>>> I get a problem if the drools engine get into the message chain.
>>>>>>>>> Then I only
>>>>>>>>> can send 23 Messages (always 23!!) until my tcp client reports me
>>>>>>>>> a
>>>>>>>>> connection timeout and the connectors get stuck. I can only
>>>>>>>>> press STRG+C in
>>>>>>>>> the Servicemix Console Window to restart Servicemix and send 23
>>>>>>>>> Messages.
>>>>>>>>> This sending of this 23 Messages work fine. They take the way I
>>>>>>>>> defined in
>>>>>>>>> my .drl where it depends on the message content if it is send to
>>>>>>>>> the tcp or
>>>>>>>>> the http server. I also get the response back to the client.
>>>>>>>>>
>>>>>>>>> This is the output when I press STRG+C. This whole stacktrace is
>>>>>>>>> printed out
>>>>>>>>> 23 times.
>>>>>>>>>
>>>>>>>>> INFO - ServiceAssemblyLifeCycle - Shutting down service
>>>>>>>>> assembly:
>>>>>>>>> droolsrouter-sa
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> droolsrouter-su
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> httpprovider-su
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> tcpconsumer-su
>>>>>>>>> INFO - ServiceUnitLifeCycle - Shutting down service
>>>>>>>>> unit:
>>>>>>>>> tcpprovider-su
>>>>>>>>> INFO - JBIContainer - ServiceMix JBI Container
>>>>>>>>> (ServiceMix) stopped
>>>>>>>>> [Fatal Error] :1:89: Content is not allowed in trailing section.
>>>>>>>>> ERROR - DroolsComponent - Error processing
>>>>>>>>> exchange InOut[
>>>>>>>>> id: ID:10.22.20.113-11b93600c6f-4:0
>>>>>>>>> status: Active
>>>>>>>>> role: provider
>>>>>>>>> service: {http://knapp.com/tcphttp}myRouter
>>>>>>>>> endpoint: myRouter
>>>>>>>>> in: <?xml version="1.0" encoding="UTF-8"?><message
>>>>>>>>> type="http"><text>hallo</text></message>
>>>>>>>>> out: Unable to display: org.xml.sax.SAXParseException: Content
>>>>>>>>> is not
>>>>>>>>> allowed in trailing section.
>>>>>>>>> ]
>>>>>>>>> org.drools.spi.ConsequenceException:
>>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>>
>>>>>>>>> )
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>>
>>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>>
>>>>>>>>> oker.java:20)
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>>
>>>>>>>>> ... 16 more
>>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>>
>>>>>>>>> ... 23 more
>>>>>>>>> ERROR - DroolsComponent - Error setting exchange
>>>>>>>>> status to
>>>>>>>>> ERROR
>>>>>>>>> java.lang.IllegalStateException: component is not owner when
>>>>>>>>> trying to set
>>>>>>>>> error: org.drools.spi.ConsequenceException: j
>>>>>>>>> avax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:516)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>>>>>>
>>>>>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>>>>> Caused by: org.drools.spi.ConsequenceException:
>>>>>>>>> javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13
>>>>>>>>>
>>>>>>>>> )
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.drools(DroolsEndpoint.java:183)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.DroolsEndpoint.process(DroolsEndpoint.java:177)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:597)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:548)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:502)
>>>>>>>>>
>>>>>>>>> ... 8 more
>>>>>>>>> Caused by: javax.jbi.messaging.MessagingException:
>>>>>>>>> java.lang.InterruptedException
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:102)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.routeTo(JbiHelper.java:151)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.model.JbiHelper.route(JbiHelper.java:109)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0.consequence(Rule_tcphttp_http_0.java:14)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.drools.Rule_tcphttp_http_0ConsequenceInvoker.evaluate(Rule_tcphttp_http_0ConsequenceInv
>>>>>>>>>
>>>>>>>>> oker.java:20)
>>>>>>>>> at
>>>>>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
>>>>>>>>>
>>>>>>>>> ... 16 more
>>>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>>>> at java.lang.Object.wait(Native Method)
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
>>>>>>>>>
>>>>>>>>> ... 23 more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> So my rule.drl looks like:
>>>>>>>>>
>>>>>>>>> package org.apache.servicemix.drools
>>>>>>>>>
>>>>>>>>> import org.apache.servicemix.drools.model.Exchange;
>>>>>>>>>
>>>>>>>>> global org.apache.servicemix.drools.model.JbiHelper jbi;
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> rule "tcphttp:http"
>>>>>>>>> when
>>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>>> null );
>>>>>>>>> eval( inmsg.xpath("/message/@type = \"http\""))
>>>>>>>>> then
>>>>>>>>>
>>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!http!!!!!!!!!!!!!!!!!!!!!!!
>>>>>>>>> ");
>>>>>>>>> jbi.route(
>>>>>>>>> "service:http://knapp.com/tcphttp/dhttp_provider" );
>>>>>>>>> end
>>>>>>>>>
>>>>>>>>> rule "tcphttp:tcp"
>>>>>>>>> when
>>>>>>>>> me : Exchange( status == Exchange.ACTIVE, inmsg : in !=
>>>>>>>>> null );
>>>>>>>>> eval( inmsg.xpath("/message/@type = \"tcp\""));
>>>>>>>>> then
>>>>>>>>>
>>>>>>>>> System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!tcp!!!!!!!!!!!!!!!!!!
>>>>>>>>> ");
>>>>>>>>> jbi.route(
>>>>>>>>> "service:http://knapp.com/tcphttp/dtcp_provider" );
>>>>>>>>> end
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> My xbean.xml for the drools su:
>>>>>>>>>
>>>>>>>>> <beans xmlns:drools="http://servicemix.apache.org/drools/1.0"
>>>>>>>>> xmlns:tcphttp="http://knapp.com/tcphttp"
>>>>>>>>> xmlns="http://www.springframework.org/schema/beans"
>>>>>>>>>
>>>>>>>>> xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>> xsi:schemaLocation="http://servicemix.apache.org/drools/1.0
>>>>>>>>> http://servicemix.apache.org/schema/servicemix-drools-3.2.2.xsd
>>>>>>>>> http://www.springframework.org/schema/beans
>>>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>>>>>>>>>
>>>>>>>>> <drools:endpoint service="tcphttp:myRouter"
>>>>>>>>> endpoint="myRouter"
>>>>>>>>> ruleBaseResource="classpath:rule.drl"
>>>>>>>>> namespaceContext="#nsContext" />
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <drools:namespace-context id="nsContext">
>>>>>>>>> <drools:namespaces>
>>>>>>>>> <drools:namespace
>>>>>>>>> prefix="tcphttp">http://knapp.com/tcphttp</drools:namespace>
>>>>>>>>> </drools:namespaces>
>>>>>>>>> </drools:namespace-context>
>>>>>>>>>
>>>>>>>>> </beans>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>>
>
>
>
--
View this message in context: http://www.nabble.com/Drools-BindingComponent-get-Stuck-after-sending-23-Messages----tp18833113p18848360.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.