[JBoss ESB Development] New message: "Re: Smooks problem"
by Gilles Dupont Tagne Tagne
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/519789#519789
Author : Gilles Dupont Tagne Tagne
Profile : http://community.jboss.org/people/tagnegilles
Message:
--------------------------------------------------------------
deployment.xml
<jbossesb-deployment>
<depends>jboss.esb.splitter:service=Queue,name=splitterQueue</depends>
<depends>jboss.esb.splitter:service=Queue,name=splitterAgeESBQueue</depends>
<depends>jboss.esb:deployment=smooks.esb</depends>
<!--
<depends>splitter:service=SplitterSqlDatabaseInitializer</depends> -->
</jbossesb-deployment>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd ">
<persistence-unit name="persondb" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>java:/SplitterSqlDB</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
</persistence-unit>
</persistence>
PersonAge.java
package de.gilles.projects.splitteresb;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="PERSON_AGE_TABLE")
public class PersonAge implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@Column(name="PERSON_ID",nullable=false,unique=true)
private Integer id;
@Column(name="PERSON_AGE", nullable=false)
private Integer age;
public PersonAge() {}
public PersonAge(Integer id, Integer age) {
this.id = id;
this.age = age;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519789#519789
16 years, 2 months
[JBoss ESB Development] New message: "Re: Smooks problem"
by Gilles Dupont Tagne Tagne
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/519788#519788
Author : Gilles Dupont Tagne Tagne
Profile : http://community.jboss.org/people/tagnegilles
Message:
--------------------------------------------------------------
splitter-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>SplitterSqlDB</jndi-name>
<connection-url>jdbc:hsqldb:hsql://localhost:1704</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<user-name>sa</user-name>
<password></password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<depends>jboss:service=SplitterSqlDB</depends>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
</local-tx-datasource>
<mbean code="org.jboss.internal.soa.esb.dependencies.HypersonicDatabase"
name="jboss:service=SplitterSqlDB">
<attribute name="Port">1704</attribute>
<attribute name="BindAddress">localhost</attribute>
<attribute name="Database">SplitterSqlDB</attribute>
<attribute name="Silent">true</attribute>
<attribute name="Trace">false</attribute>
<attribute name="No_system_exit">true</attribute>
<attribute name="DataDir">${jboss.server.data.dir}</attribute>
</mbean>
</datasources>
myEsbmq-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server PUBLIC -//JBoss//DTD MBean Service 5.0//EN http://www.jboss.org/j2ee/dtd/jboss-service_5_0.dtd >
<server>
<mbean code="org.jboss.jms.server.destination.QueueService"
name="jboss.esb.splitter:service=Queue,name=splitterQueue"
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
<mbean code="org.jboss.jms.server.destination.QueueService"
name="jboss.esb.splitter:service=Queue,name=splitterAgeESBQueue"
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
<mbean code="org.jboss.jms.server.bridge.BridgeService" name="splitter:service=Bridge,name=SplitterAgeBridge"
xmbean-dd="xmdesc/Bridge-xmbean.xml">
<!-- The JNDI lookup for the source destination -->
<attribute name="SourceDestinationLookup">/queue/splitterAgeESBQueue</attribute>
<!-- The JNDI lookup for the target destination -->
<attribute name="TargetDestinationLookup">/queue/splitterAgeQueue</attribute>
<!--
The username to use for the source connection <attribute
name="SourceUsername">bob</attribute>
-->
<!--
The password to use for the source connection <attribute
name="SourcePassword">cheesecake</attribute>
-->
<!--
The username to use for the target connection <attribute
name="TargetUsername">mary</attribute>
-->
<!--
The password to use for the target connection <attribute
name="TargetPassword">hotdog</attribute>
-->
<!--
Optional: The Quality Of Service mode to use, one of:
QOS_AT_MOST_ONCE = 0; QOS_DUPLICATES_OK = 1; QOS_ONCE_AND_ONLY_ONCE =
2;
-->
<attribute name="QualityOfServiceMode">0</attribute>
<!--
JMS selector to use for consuming messages from the source <attribute
name="Selector">specify jms selector here</attribute>
-->
<!--
The maximum number of messages to consume from the source before
sending to the target
-->
<attribute name="MaxBatchSize">1</attribute>
<!--
The maximum time to wait (in ms) before sending a batch to the target
even if MaxBatchSize is not exceeded. -1 means wait forever
-->
<attribute name="MaxBatchTime">-1</attribute>
<!--
If consuming from a durable subscription this is the subscription
name <attribute name="SubName">mysub</attribute>
-->
<!--
If consuming from a durable subscription this is the client ID to use
<attribute name="ClientID">myClientID</attribute>
-->
<!--
The number of ms to wait between connection retrues in the event
connections to source or target fail
-->
<attribute name="FailureRetryInterval">5000</attribute>
<!--
The maximum number of connection retries to make in case of failure,
before giving up -1 means try forever
-->
<attribute name="MaxRetries">-1</attribute>
<!--
If true then the message id of the message before bridging will be
added as a header to the message so it is available to the receiver.
Can then be sent as correlation id to correlate in a distributed
request-response
-->
<attribute name="AddMessageIDInHeader">false</attribute>
<!--
The JMS provider loader that is used to lookup the source destination
-->
<depends optional-attribute-name="SourceProviderLoader">
jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<!--
The JMS provider loader that is used to lookup the target destination
-->
<depends optional-attribute-name="TargetProviderLoader">
jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<depends>jboss.esb.splitter:service=Queue,name=splitterAgeESBQueue</depends>
</mbean>
<mbean code="org.jboss.jms.server.bridge.BridgeService" name="splitter:service=Bridge,name=SplitterBridge"
xmbean-dd="xmdesc/Bridge-xmbean.xml">
<!-- The JNDI lookup for the source destination -->
<attribute name="SourceDestinationLookup">/queue/splitterQueue</attribute>
<!-- The JNDI lookup for the target destination -->
<attribute name="TargetDestinationLookup">/queue/splitterMDQueue</attribute>
<!--
The username to use for the source connection <attribute
name="SourceUsername">bob</attribute>
-->
<!--
The password to use for the source connection <attribute
name="SourcePassword">cheesecake</attribute>
-->
<!--
The username to use for the target connection <attribute
name="TargetUsername">mary</attribute>
-->
<!--
The password to use for the target connection <attribute
name="TargetPassword">hotdog</attribute>
-->
<!--
Optional: The Quality Of Service mode to use, one of:
QOS_AT_MOST_ONCE = 0; QOS_DUPLICATES_OK = 1; QOS_ONCE_AND_ONLY_ONCE =
2;
-->
<attribute name="QualityOfServiceMode">0</attribute>
<!--
JMS selector to use for consuming messages from the source <attribute
name="Selector">specify jms selector here</attribute>
-->
<!--
The maximum number of messages to consume from the source before
sending to the target
-->
<attribute name="MaxBatchSize">1</attribute>
<!--
The maximum time to wait (in ms) before sending a batch to the target
even if MaxBatchSize is not exceeded. -1 means wait forever
-->
<attribute name="MaxBatchTime">-1</attribute>
<!--
If consuming from a durable subscription this is the subscription
name <attribute name="SubName">mysub</attribute>
-->
<!--
If consuming from a durable subscription this is the client ID to use
<attribute name="ClientID">myClientID</attribute>
-->
<!--
The number of ms to wait between connection retrues in the event
connections to source or target fail
-->
<attribute name="FailureRetryInterval">5000</attribute>
<!--
The maximum number of connection retries to make in case of failure,
before giving up -1 means try forever
-->
<attribute name="MaxRetries">-1</attribute>
<!--
If true then the message id of the message before bridging will be
added as a header to the message so it is available to the receiver.
Can then be sent as correlation id to correlate in a distributed
request-response
-->
<attribute name="AddMessageIDInHeader">false</attribute>
<!--
The JMS provider loader that is used to lookup the source destination
-->
<depends optional-attribute-name="SourceProviderLoader">
jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<!--
The JMS provider loader that is used to lookup the target destination
-->
<depends optional-attribute-name="TargetProviderLoader">
jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<depends>jboss.esb.splitter:service=Queue,name=splitterQueue</depends>
</mbean>
</server>
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519788#519788
16 years, 2 months
[JBoss ESB Development] New message: "Smooks problem"
by Gilles Dupont Tagne Tagne
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/519787#519787
Author : Gilles Dupont Tagne Tagne
Profile : http://community.jboss.org/people/tagnegilles
Message:
--------------------------------------------------------------
Hi Gays,
I try to use smooks in my ESB project to store some data in an exterm database. But it doesn't work. I am doing may be something wrong. Please i need your help. I am using JBossESB 4.7 in JBoss AS 5.1.0 jdk6
jboss-esb.xml
<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..."
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml... http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml...">
<providers>
<jms-provider connection-factory="ConnectionFactory" name="JbossMessaging">
<jms-bus busid="splitterChannel">
<jms-message-filter dest-name="/queue/splitterQueue" dest-type="QUEUE"/>
</jms-bus>
</jms-provider>
<schedule-provider name="CronSchedulerProvider">
<cron-schedule cronExpression="0/3 * * * * ?" scheduleid="myCronSchedule"/>
</schedule-provider>
<fs-provider name="FileSystemProvider">
<fs-bus busid="esbFileSystem">
<fs-message-filter directory="/Users/gilles/Desktop/ESB/Input"
error-delete="false"
error-directory="/Users/gilles/Desktop/ESB/Error"
error-suffix=".error" input-suffix=".csv" post-delete="true"
post-directory="/Users/gilles/Desktop/ESB/Post" post-suffix=".post" work-suffix=".work"/>
</fs-bus>
</fs-provider>
</providers>
<services>
<service category="splitterTest" description="Splitt the .csv file"
invmScope="GLOBAL" name="fileSplitter">
<listeners>
<fs-listener busidref="esbFileSystem" is-gateway="true"
name="FileListener" scheduleidref="myCronSchedule">
<property name="composer-class" value="org.jboss.soa.esb.smooks.splitting.FileStreamSplitter"/>
<property name="splitterConfig" value="/mySmooksConf.xml"/>
</fs-listener>
</listeners>
<actions mep="OneWay">
<action class="org.jboss.soa.esb.actions.SystemPrintln" name="Print">
<property name="message" value="[Splitter] Message Split complete"/>
</action>
</actions>
</service>
<service category="splitterTest"
description="Route the message to a jms queue" invmScope="GLOBAL" name="routerSplitter">
<actions mep="OneWay">
<action class="org.jboss.soa.esb.actions.Notifier" name="NotifyAction1">
<property name="destinations">
<NotificationList type="ok">
<target class="NotifyQueues">
<queue jndiName="queue/splitterQueue"/>
</target>
</NotificationList>
</property>
<property name="okMethod" value="notifyOK"/>
</action>
<!-- Alte Version
<action class="org.jboss.soa.esb.actions.routing.JMSRouter" name="jmsRouter">
<property name="unwrap" value="true"/>
<property name="jndiName" value="queue/splitterQueue"/>
</action> -->
</actions>
</service>
<service category="splitterTest"
description="Route the age element of the message to a jms queue"
invmScope="GLOBAL" name="routerAgeSplitter">
<actions mep="OneWay">
<action class="org.jboss.soa.esb.actions.Notifier" name="NotifyAction2">
<property name="destinations">
<NotificationList type="ok">
<target class="NotifyQueues">
<queue jndiName="queue/splitterAgeESBQueue"/>
</target>
</NotificationList>
</property>
<property name="okMethod" value="notifyOK"/>
</action>
<!--
<action class="org.jboss.soa.esb.actions.routing.JMSRouter" name="jmsRouterAge">
<property name="unwrap" value="true"/>
<property name="jndiName" value="queue/splitterAgeESBQueue"/>
</action> -->
</actions>
</service>
<service category="splitterTest" description="Make routing on Age"
invmScope="GLOBAL" name="recipientListAge">
<actions mep="OneWay">
<action class="org.jboss.soa.esb.actions.StaticRouter" name="staticRoutingAge">
<property name="destinations">
<route-to destination-name="ToRouterAgeSplitter"
service-category="splitterTest" service-name="routerAgeSplitter"/>
<route-to destination-name="ToDbPersistAge"
service-category="splitterTest" service-name="dbPersist"/>
</property>
</action>
</actions>
</service>
<service category="splitterTest"
description="Persist data in the database" invmScope="GLOBAL" name="dbPersist">
<actions mep="OneWay">
<action class="org.jboss.soa.esb.actions.SystemPrintln" name="PrintMessage1">
<property name="message" value="Message"/>
</action>
<action class="org.jboss.soa.esb.smooks.SmooksAction" name="smoksActionXML">
<property name="smooksConfig" value="/xmlSmooksConf.xml"/>
</action>
<action class="org.jboss.soa.esb.actions.SystemPrintln" name="PrintMessage2">
<property name="message" value="Message"/>
</action>
<action class="org.jboss.soa.esb.smooks.SmooksAction" name="smoksActionDB">
<property name="smooksConfig" value="/dbSmooksConf.xml"/>
</action>
</actions>
</service>
</services>
</jbossesb>
mySmooksConf.xml
<?xml version="1.0" encoding="UTF-8"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd"
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<params>
<param name="stream.filter.type">SAX</param>
</params>
<csv:reader fields="id,firstname,lastname,age" rootElementName="liste" recordElementName="person">
<csv:singleBinding beanId="personvirtual" class="java.util.HashMap"/>
</csv:reader>
<ftl:freemarker applyOnElement="person">
<ftl:template><!--${personvirtual.id},${personvirtual.firstname},${personvirtual.lastname}--></ftl:template>
<ftl:use>
<ftl:bindTo id="personFragment" />
</ftl:use>
</ftl:freemarker>
<ftl:freemarker applyOnElement="person">
<ftl:template><!--${personvirtual.id},${personvirtual.age}--></ftl:template>
<ftl:use>
<ftl:bindTo id="personAgeFragment" />
</ftl:use>
</ftl:freemarker>
<esbr:routeBean beanIdRef="personFragment" toServiceCategory="splitterTest" toServiceName="routerSplitter" routeOnElement="person"/>
<esbr:routeBean beanIdRef="personAgeFragment" toServiceCategory="splitterTest" toServiceName="recipientListAge" routeOnElement="person"/>
</smooks-resource-list>
xmlSmooksConf.xml
<?xml version="1.0" encoding="UTF-8"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<params>
<param name="stream.filter.type">SAX</param>
</params>
<csv:reader fields="id,age" rootElementName="personliste" recordElementName="person"/>
</smooks-resource-list>
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519787#519787
16 years, 2 months