ServiceMix 4
  1. ServiceMix 4
  2. SMX4-454

Provide example : camel-loadbalancing-cxf-jax-rs-dao

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.6.0
    • Component/s: None
    • Labels:
      None

      Description

      I will provide my code for the users interested to do this kind of architecture in SMX4

      REST requests can be balanced across several jetty / HTTP Servers. The requests are processed by CXF Bean endpoint extracting the information (operation type; parameters) and placed in ActiveMQ queue. Another camel route process the messages from the queue and dependingon the operation type call the method of a service bean (= DAO). This class is handled by Spring/EclipseLink and connect to a DB (HSQLDB/Derby) to post or retrieve data. The result is send back to the CXF bean endpoint

      Remark : To have a real cluster architecture, users could deploy the second camel route in several instances (same SMX4 server or separate) in order to show that we can consume messages of a queue from different endpoints (if one fails, another can process it)

      Technology involved :

      • Spring OSGI Service
      • Spring ORM
      • EclipseLink JPA
      • Camel (camel-jetty, camel-cxf, camel-http, camel-jms, loadbalancing, routing)
      • DAO
      1. reportincident-rest.zip
        425 kB
        Charles Moulliard

        Activity

        Hide
        Charles Moulliard added a comment -

        Here is the maven project + README file

        Show
        Charles Moulliard added a comment - Here is the maven project + README file
        Hide
        Jean-Baptiste Onofré added a comment -

        I'm going to test the example and add it in the SMX4 samples set.

        Thanks Charles

        Show
        Jean-Baptiste Onofré added a comment - I'm going to test the example and add it in the SMX4 samples set. Thanks Charles
        Hide
        Charles Moulliard added a comment -

        Remark : The activemq-camel bundle 5.3.0 does not work for the moment as the version range does not accept camel 2.x. The workaround is to open the jar file before to install it in SMW4/Karaf using winrar and changing in the MANIFEST file the version range of the camel import package to [2.0,2.5) or [1.5,2.5)

        Show
        Charles Moulliard added a comment - Remark : The activemq-camel bundle 5.3.0 does not work for the moment as the version range does not accept camel 2.x. The workaround is to open the jar file before to install it in SMW4/Karaf using winrar and changing in the MANIFEST file the version range of the camel import package to [2.0,2.5) or [1.5,2.5)
        Hide
        Charles Moulliard added a comment -

        error in the pom.xml file (test module removed)

        Show
        Charles Moulliard added a comment - error in the pom.xml file (test module removed)
        Hide
        Charles Moulliard added a comment -

        README file modified for SMX4 :

        Show
        Charles Moulliard added a comment - README file modified for SMX4 : display list of bundles for SMX4 change eclipselink --> eclipsejpa folder (error) add bundle spring: file:etc/activemq-broker.xml
        Hide
        Charles Moulliard added a comment -

        Tested successfully on last SMX4 snapshot

        Show
        Charles Moulliard added a comment - Tested successfully on last SMX4 snapshot
        Hide
        Gert Vanthienen added a comment -

        Deferring to 4.5.0

        Show
        Gert Vanthienen added a comment - Deferring to 4.5.0

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Charles Moulliard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development