Reliable Asynchronous Web Services on Java EE JOnAS server and Apache CXF

1,997 views

Published on

With the new OW2 JOnAS MDB transport for Apache CXF, reliable Asychronous WS are here by using a JMS transport.

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • DEAR FRIEND, I AM MR. MORRIS COULIBALY. I HAVE A LATE CLIENT WHO LEFT THE SUM OF $11. 5 MILLION DOLLARS IN OUR BANK I AM HIS PERSONAL ACCOUNT OFFICER I CONTACTED YOU BECAUSE YOU HAVE THE SAME LAST NAME OR SURNAME WITH THE DECEASED CLIENT AND I CAN PRESENT YOU AS THE BENEFICIARY AND NEXT OF KIN TO THE FUND SINCE YOU BEAR THE SAME SURNAME WITH MY LATE CLIENT. THE FUND WILL BE SHARE AMONG TWO OF US 50% EACH . I WAIT TO HEAR FROM YOU SO THAT I WILL GIVE YOU MORE DETAILS ON HOW THE FUND WILL BE RELEASE AND TRANSFER INTO YOUR BANK ACCOUNT . PLEASE CONTACT ME BACK IF YOU ARE INTERESTED FOR MORE DETAILS BEST REGARDS, . MR. MORRIS COULIBALY
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
1,997
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
101
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Reliable Asynchronous Web Services on Java EE JOnAS server and Apache CXF

  1. 1. # 1 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Reliable asynchronous web-services with Apache CXF New CXF transport allowing reliable Web Services based on JMS transport and JTA transaction. Florent Benoit, BULL/OW2 [ @florentbenoit ] Guy Vachet, France Telecom [guy.vachet@orange-ftgroup.com]
  2. 2. # 2 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Context / History
  3. 3. # 3 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. France Telecom Orange context ● Large heterogeneous IS ● Over 3000 interconnected applications ● Since 2006, generalized web services usage with SOAP over HTTP, in order to: – standardize exchanges between applications – create facades between the front end and the legacy back-office ● SOAP over HTTP drawbacks ● Tightly-coupled transport ● Services inaccessible when the provider is inactive ● Difficulty to analyze failures (404-type errors) ● Long-lasting back office operations unadapted to real-time front-end interactions: we need asynchronism!
  4. 4. # 4 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. SOAP over JMS proposal ● Objectives ● Real asynchronous client-server exchange ● Guarantee the reliability of message delivery (no message loss, no duplicate) ● JTA Transactional features – client-side: between its resources and the message sent – server-side: between message reading and its resources – similarly for responses ● Technical context ● WSDL first ● Based on CXF2.1 ● Standard Java EE context: JOnAS (Java EE) and JORAM (JMS)
  5. 5. # 5 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Limitations of the async. CXF proposal ● Current proposal on Apache side for asynchronous transport seems to present some limitations: ● One thread per request – scalability? ● Memory-based mechanism – recovery after crash? ● No transaction support – message sending/receiving ● Our objective: define an alternative solution ● respecting our objectives and context ● to be integrated smoothly in CXF
  6. 6. # 6 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. A new proposal
  7. 7. # 7 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Content of the new Proposal ● Based on Apache CXF ● Use benefits of EJB Message Driven Bean instead of simple « JMS Message Listener» ● JTA Transaction support (Java EE standard) ● Use of a pool of objects for handling requests ● New CXF Transport: named MDB (url = mdb://) ● Based on some parts of the CXF/JMS library (used for some functions like building a JMS message from a CXF message) ● 3 parts ● Client: sending and receiving ● Server: endpoint
  8. 8. # 8 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Global architecture view
  9. 9. # 9 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Handling errors [1/2]
  10. 10. # 10 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Handling errors [2/2] ● If there is a failure when a Message Driven Bean is handling a JMS message, new attempts to redeliver the message will occur (one retry for each failure as per JMS specification) ● For each failure: – Transaction rollback ● All database operations (or involving other XA resources) are canceled ● Upon reaching a specified number of repetitive failures: → Sending the fault message to a « Dead Message Queue » ● JMS Persistent messages ● When we restart servers, all persisted messages will be delivered – No message loss
  11. 11. # 11 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Prerequisites ● Java EE server: (Tested with JOnAS 5.2.0 M3) ● Java EE 5 application server with EJB 3.1 Singleton bean support ● Java EE 6 App server ● JMS server (Tested with JOnAS/JORAM) ● Spring is used for the Transport configuration ● Spring already used by CXF
  12. 12. # 12 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Availability [1/2] ● Code hosted on OW2 JOnAS forge ● JOnAS subproject: – Own life-cycle following CXF releases ● Module available through the OW2 maven repository (and Maven Central repository) ● Metrics ● 2 interfaces (AsyncHandler and ContextInfo) ● 10 new classes ● ≈ 1500 Lines of code (without examples / tests)
  13. 13. # 13 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Availability [2/2] ● Easy to plug: → Add a new MDB CXF transport = Adding MDB transport jar as library in the class-path ● Integrated with: ● CXF 2.2.x (2.2.11) ● CXF 2.3.x (2.3.0) ● Available by default on JOnAS application server (nothing to do) → JOnAS 5.2.0 M4 SNAPSHOT ● Wish to contribute back this transport to the Apache CXF community
  14. 14. # 14 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Demo
  15. 15. # 15 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Demo use-case [1/2]
  16. 16. # 16 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Demo use-case [2/2] ● One server with JMS ● JOnAS hosting all JMS Queues (« endpoint » queue and «client answer» queue ● JMS server used is JORAM ● 3 JOnAS servers – JOnAS 1: Sending messages from a client – JOnAS 2: WS Endpoint – JOnAS 3: Handling response on the client side ● Crash recovery demo for servers JOnAS2 and JOnAS3
  17. 17. # 17 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Conclusion
  18. 18. # 18 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Conclusion ● France Telecom Orange started to use this transport. ● Some projects are experimenting this. ● Global idea is to contribute back this MDB protocol to Apache CXF community ● Available on http://wiki.jonas.ow2.org/xwiki/bin/view/Main/MDB_Transport_CXF
  19. 19. # 19 OW2 Annual Conference 2010, November 24-25, La Cantine, Paris. www.ow2.org. Q & A Florent Benoit, BULL/OW2 [ @florentbenoit ] Guy Vachet, France Telecom

×