Use the Eclipse File -> New JBoss ESB Project.
Name the project the name of the service. E.g.DiscountService.
Use the JBoss ESB editor to edit the jboss-esb.xml file.
First add the providers to jboss-esb.xml.
With ESB services deployed as web services there are no gateway providers required, instead only a single JMS provider is
required for the ESB Service endpoint. |
Use the JBoss ESB Editor to create the service. Name it the same as the project, and name the Category TaskServices (or pick some other category naming convention).
Create a listener and choose the jms-jca-provider as it is better performing.
Use the source tab to add the XSD of the request message, response message, and fault message.
Add a SmooksAction to map the XML to POJOs.
Create a smooks-res.xml file to configure this transformation based on rules fact model and the task. |
For Drools-based task services, add a BusinessRulesProcessor action to perform the business logic.
Add the name of the rule depl;oyment properties file for the specified rule (or the rulefile itself)
Also add the names of the facts to be inserted into the rule engine working memory using the "object-paths" property.
Example jboss-esb.xml element for a task service:
<service category="TaskServices"
name="DiscountService"
description="Discount Task Service">
<listeners>
<jms-listener name="discount"
busidref="discountChannel"
maxThreads="1" />
</listeners>
<actions inXsd="/discountRequest.xsd"
outXsd="/discountResponse.xsd"
faultXsd="/discountFault.xsd">
<action name="transformToPOJO"
class="org.jboss.soa.esb.smooks.SmooksAction">
<property name="smooksConfig" value="/smooks-requues.xml" />
</action>
<action name="calculate discount"
class="org.jboss.soa.esb.actions.BusinessRulesProcessor" >
<property name="ruleAgentProperties"
value="ruleAgent/discount-rules-deployment.properties" />
<property name="object-paths">
<object-path esb="Account" />
<object-path esb="TollTransaction" />
</property>
</action>
</actions>
</service>
|
Add another SmooksAction to transform POJOs back to XML
Use FreemarkerTemplate approach |
Add another SmooksAction to transform POJOs back to XML
Add another SmooksAction to transform POJOs back to XML
|