|
JBossESBLegStarAdapterQuickStartAnt
QuickStart descriptionThe purpose of this quickstart document is to quickly build a functioning sample integrating JBoss ESB with a backend IBM CICS system. Once deployed, the generated ESB component will act as an adapter for the sample CICS COBOL program LSFILEAE. ESB clients can then consume the ESB component without any knowledge of the actual legacy backend system:
InstallationFollow instructions in:InstallInstructions The installed CICS modules include the LSFILEAE COBOL sample program that we will be using for this quickstart. We will be using HTTP connectivity to CICS for this quickstart (Alternatively, you can use Sockets or Websphere MQ). Generate a JBoss ESB service adapter for a mainframe programThese steps will guide you through the process of generating an ESB adapter using ant scripts. There is an alternative method, using Eclipse plugins, that is described in JBossESBLegStarAdapterQuickStartEclipse. First step is to generate an XML schema from the source of the target COBOL program LSFILEAE. Go to folder samples/jbossesb/quickstarts/legstar_adapter. From the ant folder, run command ant -f build-cob2xsd.xml. This should create a schema folder with a generated XML schema lsfileae.xsd. If you open lsfileae.xsd you will notice that each COBOL data structure in the LSFILEAE COBOL source has been mapped to an XML Schema type. Next step turns the XML schema types into Java annotated classes. This is achieved with 2 ant scripts:
As a result, the src folder contains generated java classes which implement COBOL to Java transformers. These were derived from the sample XML Schema in the schema folder. Sources are also compiled, with binaries stored under the build folder. The last step generates the legstar-lsfileae.esb JBoss ESB service. From the ant folder run command ant -f build-jbossesb2cixs.xml. Under src/com/legstar/test/cixs/jbossesb/lsfileae you will find the generated LsfileaeAction.java source of the actual JBoss ESB action. Under legstar_adapter, JBoss ESB configuration samples are generated:
Is the JBoss ESB service descriptor. This sample service implements a sequence of 2 actions (not counting debug trace actions). The first action performs the actual call to the mainframe program, the second one drops the result into a JMS queue.
Describe the JMS queues used by the generated ESB service. The ant folder contains the generated build-esb.xml ant script which bundles the legstar-lsfileae.esb file and the deploy.xml ant script which deploys the generated service to your JBoss ESB installation (Defined by the JBOSS_HOME environment variable). Go ahead and run ant -f deploy.xml. If JBoss ESB is running, you should get messages like these: 19:21:14,134 INFO [JBoss4ESBDeployer] create esb service, legstar-lsfileae.esb 19:21:14,212 INFO [QueueService] Queue[/queue/lsfileae_Request_gw_reply] started, fullSize=200000, pageSize=2000, downCacheSize=2000 19:21:14,227 INFO [QueueService] Queue[/queue/lsfileae_Request_gw] started, fullSize=200000, pageSize=2000, downCacheSize=2000 Running the ESB service adapterOnce the esb is deployed, any JMS client can use it. The src/com/legstar/cixs/jbossesb/test/lsfileae folder contains a SendJMSMessage java program that you can use to invoke the newly deployed service. This program expects a parameter value. Passing a string with a value such as "100" should return the content of the CICS file FILEA for customer 100. You can use JBoss Messaging as the JMS provider for this test in which case, you will need the following jars on your classpath:
|