Index Changes

Getting Started

This page provides details on creating and running the Milestone 2 demo application. Before we get down to business, check the following items to make sure you are ready to rock!
  • Have you watched the Milestone 2 Demo screencast? If not, check it out. You will see the same application you are about to build in action.
  • Do you have NetBeans 6.1? Technically, it's not required to use Fuji, but it will be easier to follow the instructions if you do. If you would like instructions for running in another IDE like Eclipse, or you want to get down on the command-line, send us an email and we will help you out.

Overview

Step-by-Step

Prepare Your Environment

Configure and Build the Application

Start Your Engines!





Environment Setup

NetBeans Configuration



Add Fuji Instance to NetBeans

  • Select 'Services' tab in left-frame of NetBeans
  • Right-click 'Fuji Servers' and select 'Add Server'
  • Root Directory and Working Directory should be the name of the directory where you extracted Fuji. note: this path ends in /fuji
  • Click Finish
  • Right-click the server you created and select 'Start'



Create the database and table

  • Select 'Services' tab in left-frame of NetBeans
  • Right-click 'Databases' and select 'New Connection...'
  • Fill out URL, userid, and password. See this pic(info) for details.
    • Database URL: jdbc:derby://localhost:1600/m2demo;create=true
    • User Name: app
    • Password : app
  • Right-click on the URL you just created under 'Databases' and select 'Connect'
  • Right-click on the URL you just created under 'Databases' and select 'Execute Command'
  • Enter the following SQL and run it (right-click in editor):
CREATE TABLE DELIVERY (
    CONTAINER_ID VARCHAR(60),
    SHIPPER_ID VARCHAR(60)
)



Deploy and start MDM service

  • Download the MDM service bundle(info).
    • Note: If you are using the M4 distribution to run this demo, please use this m2mdm jar(info).
  • Right click on your fuji instance in the Services tab and select 'Install Bundle...'
  • In the file chooser, select m2mdm.jar.
  • Under Service Assemblies, right click on the application and select 'Start'




Building the Application

Configure the services

Deploy and Start

  • Right click on your fuji instance in the Services tab and select 'Install Bundle...'
  • In the file chooser, make sure you are in the application directory and select app.jar.
  • Under Service Assemblies, right click on the application and select 'Start'




Running the Application

Trigger the integration flow

  • Copy a payload file into the FTP inbox directory. Using the configuration below, the full path would be /tmp/inbox/req.in.xml.
  • Note: If you used a recent version of the M2 application, the full path would be /tmp/in.xml.
  • Example content for the payload


Verify Success

  • Assuming you used the sample payload, you should have the following output:
    • A single email message that looks like this
    • A new record in your delivery database. Go to the services tab, right click on the DELIVERY table and select View Data..... You should see something like this.





Other Details


SMTP service configuration

Be sure to adjust these properties to match your environment.
smtp.location=mailto:testm2demo@gmail.com
smtp.smtpserver=smtp.gmail.com
smtp.useSSL=true
#These values are only required for outbound communication
smtp.username=testm2demo@gmail.com
smtp.password=password

FTP service configuration

Be sure to adjust these properties to match your environment.
An FTP server should be setup in URL provided below.
ftp.messageRepository=/tmp
ftp.messageName=in.xml
ftp.pollIntervalMillis=2000
ftp.use=literal
ftp.url=ftp://joe:secret@localhost:21
ftp.dirListStyle=UNIX
ftp.mode=BINARY

Note: If you are using a recent version of the m2app sources, you will be seeing this configuration file

# file to receive - used for inbound communication
ftp.receiveFrom=/tmp/in.xml
# file to send - used for outbound communication
ftp.sendTo=
ftp.user=joe
ftp.password=secret
ftp.host=localhost
ftp.port=21
ftp.dirListStyle=UNIX
ftp.mode=BINARY
ftp.pollIntervalMillis=2000


Database service configuration

Be sure to adjust these properties to match your environment.

###                      ###
### insert configuration ###
###                      ###
jdbc.operationType=insert
#jndi handle for datasource
jdbc.jndiName=jdbc/__defaultDS
#sql statement, e.g. INSERT INTO TEST (NAME, ID) values (?,?)
jdbc.sql=INSERT INTO DELIVERY (CONTAINER_ID, SHIPPER_ID) VALUES (?,?)
#parameter order, e.g. NAME, ID
jdbc.paramOrder=ContainerId, EUID
#table name
jdbc.TableName=DELIVERY

Inbound Payload

<Manifest>
<Container>
  <ContainerId>Ship001</ContainerId>
  <Shipper>
     <Name>Joe</Name>
     <Id>ABC123</Id>
  </Shipper>
</Container>
<Container>
  <ContainerId>Ship002</ContainerId>
  <Shipper>
     <Name>Steve</Name>
     <Id>XYZ000</Id>
  </Shipper>
</Container>
</Manifest>


Output Email

<Alarm>
 <Container>
  <ContainerId>Ship002</ContainerId>
  <Shipper>
     <Name>Steve</Name>
     <Id>XYZ000</Id>
  </Shipper>
 </Container>
</Alarm>

Database Record

CONTAINER_IDSHIPPER_ID
Ship001{12DJE23JDKCL229011}

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-53) was last changed on 16-Mar-09 13:36 PM, -0700 by Annies Abduljaffar