[Design of JBoss ESB] - Re: Design of a Content Based Routing Service
by kurt.stam@jboss.com
I have been working on the CBR configuration, and this is what we have so far:
The CBR can be started as a service by putting a fragment like this in your deployment-configuration.xml (taken from the qa/junit/src/org/jboss/soa/esb/listeners/message/ContentBasedRouting.xml):
| <ContentBasedRouter
| service-category="MessageRouting"
| service-name="ContentBasedRoutingService"
| service-description="This CBR routs messages to different service destination based whether the messageType is XML or Serializable"
| listenerClass="org.jboss.soa.esb.listeners.message.CbrJmsQueueListener"
| connection-factory="ConnectionFactory"
| destination-type="queue"
| destination-name="queue/A"
| jndi-type="jboss"
| jndi-URL="localhost"
| message-selector="service='ContentBasedRouting-SerializableOrXml'"
| >
| <cbr ruleSet="JBossESBRules.drl" />
| </ContentBasedRouter>
|
This will bring up a CBR with serviceName ContentBasedRoutingService, and it is of type CbrJmsQueueListener (which extends JmsQueueListener).
The message-selector is set to 'ContentBasedRouting-SerializableOrXml' and the section you can see the ruleset it will use is 'JBossESBRules.drl'. So if you send your message to this destination it will route this message based on that ruleSet.
Now, the outcoming of the routing is one or more destinations. Based on the setting of the flag 'MessageRouter.DELIVER_MESSAGE' in the message
the Router itself will take care of the delivery (if set to true, which is the default behavior) or if set to false it will simply return the Collection of destinationServices. This part becomes interesting when the CBR is called from an action. Let's say you have the following section in your deployment-config.xml:
| <CreditAgencyJMSOutput
| listenerClass="org.jboss.soa.esb.listeners.JmsQueueListener"
|
| actions="CreditCheckResponse-To-BankQuote, CBR-To-Banks,
| BankQuote-Transform,CBR-Deliver"
|
| maxThreads="1"
| queueConnFactoryClass="ConnectionFactory"
| listenJndiType="jboss"
| listenJndiURL="localhost"
| listenQueue="queue/A"
| listenMsgSelector="sample_loanbroker_servicecode='creditResponse'"
| >
|
| </CreditAgencyJMSOutput>
|
| <Action name="CBR-To-Banks" processor="addDestinationListToMessage" />
| <Action name="CBR-Deliver" processor="deliverToDestinations" />
|
The idea here is the Credit-Agency response is send to the CBR, which obtains the list of destinationServices. Which gets set on the message. Now before delivering them you may want to execute another action before sending it out for delivery. The action I m ade up here is the 'BankQuote-Transform'. The the next action 'CBR-Deliver', sends the message on it's merry way.
Note that if you have multiple ruleSets, you can define a Listener for each and you can then chain these routers, for example sort out the XML-based messages first (and route those with XPATH). It seems a nice way to break the ruleSets up manageable sets. The JRulesBasedRouter keeps a static HashMap of each of these ruleSets.
Well so far the update, I'm opening the floor for suggestions :).
--Kurt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983079#3983079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983079
18 years, 2 months
[Design of JBoss Transaction Services] - logging too verbose
by scott.stark@jboss.org
The tm logging levels are too verbose for our defaults. None of these message should be at INFO level as they don't conform to the logging level usage and should not be showing up on the console:
| 10:54:48,466 INFO [arjLogger] Periodic recovery - second pass <Fri, 3 Nov 2006 10:54:48>
| 10:54:48,467 INFO [arjLogger] AtomicActionRecoveryModule: Second pass
| 10:54:48,467 INFO [txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_6] - TORecoveryModule - second pass
| 10:54:48,467 INFO [loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.secondpass] Local XARecoveryModule - second pass
| 10:56:48,486 INFO [arjLogger] Periodic recovery - first pass <Fri, 3 Nov 2006 10:56:48>
| 10:56:48,486 INFO [arjLogger] StatusModule: first pass
| 10:56:48,487 INFO [txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_3] - TORecoveryModule - first pass
| 10:56:48,487 INFO [loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.firstpass] Local XARecoveryModule - first pass
|
See http://wiki.jboss.org/wiki/Wiki.jsp?page=UsageOfLoggingLevels
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983067#3983067
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983067
18 years, 2 months
[Design of JBoss jBPM] - deploying from cvs head to 4.0.4 and mysql 4.1.x job error
by kukeltje
19:36:47,421 ERROR [JobExecutorThread] exception in job executor thread. waiting 10000 milliseconds
| org.jbpm.JbpmException: couldn't get acquirable jobs
| at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:42)
| at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:111)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56)
| Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.loader.Loader.doList(Loader.java:2148)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
| at org.hibernate.loader.Loader.list(Loader.java:2024)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
| at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:38)
| ... 2 more
| Caused by: java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL serve
| r version for the right syntax to use near '1 job0_.ID_ as ID1_143_, job0_.VERSION_ as VERSION3_143_, job0_.DUEDATE_ as DUED'
| at line 1
| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
| at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
| at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
| at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
| at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
| at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930)
| at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
| at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
| at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
| at org.hibernate.loader.Loader.doQuery(Loader.java:662)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
| at org.hibernate.loader.Loader.doList(Loader.java:2145)
| ... 11 more
|
I'll try to see what it is, but if anyone has a clue it saves me time
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983062#3983062
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983062
18 years, 2 months