Giter VIP home page Giter VIP logo

servicemix4-example-payment-service's Introduction

This project is an example of using OSGi, Camel, and JBoss Fuse together. A number of things are shown within this project:

  • use of the ActiveMQ and activemq-camel component for inter OSGi bundle communication
  • multiple front-end proxies (WS and batch file)
  • bridging one way (fire and forget) messaging with request-response
  • and much more...

The scenario is a payment transfer service where transfer requests can be made either through a WS (SOAP/HTTP) interface or through batch files.

This solution is a bit over-engineered, but the goal of this effort is to provide examples of best practices in creating applications using these technologies. Following is a brief overview of the included modules. Module Overview:

  • payment-service-shared: contains wsdl and generated JAXB artifacts, providing a common data model for data moving through the system
  • payment-service-bank: process the transfer request
  • payment-service-ws: SOAP/HTTP request-response proxy for transfer service
  • payment-service-batch: splits multiple requests within a file, and forwards them to the router. Adapts a one-way process (batch file) to a request-response service (transfer).

Requirements:

To run:

  1. Build this project so bundles are deployed into your local maven repo

    $ mvn clean install

  2. Start JBoss Fuse

(See the note about adding an admin user below)

<JBoss Fuse home> $ bin/fuse
  1. Add this projects features.xml config to JBoss Fuse from the Fuse Console (makes it easier to install bundles with all required dependencies)

    JBossFuse:karaf@root> features:addUrl mvn:org.fusesource.examples/payment-service-shared/1.4.0-SNAPSHOT/xml/features

  2. Install the bundles.

    Note: payment-service-shared gets installed by the other features.

    JBossFuse:karaf@root> features:install payment-service-bank JBossFuse:karaf@root> features:install payment-service-ws JBossFuse:karaf@root> features:install payment-service-batch

    there is also a shortcut features that installs all the others

    JBossFuse:karaf@root> features:install payment-service-all

  3. To test the batch file processing, there is an existing batch file in the payment-service-batch modules.

    Note: /tmp/file-in directory is created automatically by Camel within the payment-service-batch bundle.

    $ cp payment-service-batch/transfers.xml /tmp/file-in

    To see what happened look at the JBoss Fuse log file, either from the console

    JBossFuse:karaf@root> log:display

    or from the command line

    $ tail -f data/log/fuse.log

  4. To test the WS, use your favorite WS tool (e.g. SoapUI) against the following WSDLs hosted by the payment-service-ws bundle -- http://localhost:9090/paymentService?WSDL

    you can also the payment-service-client, which shows using CXF generated client code

    payment-service/payment-service-client> mvn -PPayment

Notes

  • if you see linkage errors related to javax.activation.DataHandler, you may need to edit JBoss Fuse's etc/jre.properties file, and add javax.activation to the list of packages exported by the base bundle by uncommenting (remote the leading '#') the javax.activation line.

    jre-1.7= \
    javax.accessibility, \
    javax.activation;version="1.1", \
    javax.activity, \
    ....

  • In JBoss Fuse, make sure that you've added a admin/admin userid and password to <JBoss Fuse Home>/etc/users.properties, or update the included Camel route to the userid and password you have defined for the JBoss Fuse embedded ActiveMQ.

servicemix4-example-payment-service's People

Contributors

kevinearls avatar scranton avatar gertv avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.