Skip to content

eraserlabs/example-order-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Order Processor

An on-premises order processing service that picks up CSV order files from a Managed File Transfer (MFT) landing directory, validates and persists them to an Oracle database, and publishes order events to IBM MQ for downstream fulfillment.

Architecture

Partner systems drop CSV order files onto a shared filesystem via MFT. The service picks up these files, parses each order line, persists orders to Oracle, and publishes an event per order to an IBM MQ queue. The downstream fulfillment system consumes from that queue. The service is deployed as a WAR to JBoss EAP, sitting behind an Apache HTTP Server reverse proxy.

Infrastructure

Component Technology Deployment
Web server Apache HTTP Server Dedicated VM
App server JBoss EAP 7.4 Dedicated VM
Database Oracle 19c Dedicated VM
Message queue IBM MQ 9.3 Dedicated VM
File transfer MFT landing directory Shared filesystem

Tech Stack

  • Java 11
  • Java EE 8 (JAX-RS, CDI, JPA, JMS)
  • Maven
  • Oracle JDBC (ojdbc8)
  • IBM MQ JMS client

Project Structure

order-processor/
├── pom.xml
├── db/
│   └── create-table.sql
├── samples/
│   └── sample-orders.csv
├── src/main/
│   ├── java/com/example/orders/
│   │   ├── OrderProcessor.java        # Core logic: file pickup → DB → MQ
│   │   ├── OrderResource.java         # REST endpoints (POST /api/process, GET /api/health)
│   │   ├── model/
│   │   │   └── Order.java
│   │   ├── channels/
│   │   │   ├── FilePickup.java        # Reads CSVs from MFT landing directory
│   │   │   └── MqPublisher.java       # Publishes order events to IBM MQ
│   │   └── config/
│   │       ├── JaxRsConfig.java       # JAX-RS application setup
│   │       └── OrderRepository.java   # Persists orders to Oracle
│   ├── resources/META-INF/
│   │   └── persistence.xml            # JPA datasource config
│   └── webapp/WEB-INF/
│       └── web.xml
└── README.md

Build

mvn clean package

Produces target/order-processor.war.

Deploy

  1. Configure JBoss EAP datasource (java:jboss/datasources/OracleDS) pointing to Oracle.
  2. Configure JBoss EAP JMS connection factory (java:jboss/jms/MQConnectionFactory) and queue (java:jboss/jms/FulfillmentQueue) for IBM MQ.
  3. Run db/create-table.sql against the Oracle database.
  4. Ensure the MFT landing directory (/opt/mft/inbound/orders) is mounted and accessible from the JBoss VM.
  5. Deploy the WAR to JBoss EAP.

API

POST /api/process

Triggers processing of all CSV files currently in the MFT landing directory. In production, this would typically be called by a scheduler (cron job or EJB timer).

Returns: {"status": "processed", "count": 3}

GET /api/health

Returns {"status": "ok"}.

Sample Data

See samples/sample-orders.csv for the expected file format:

partnerId,product,quantity,unitPrice
PARTNER-001,Widget A,100,12.50

About

This repo consists of a hypothetical, boilerplate order processing service. Used for demo purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages