Skip to content

Latest commit

 

History

History
167 lines (155 loc) · 9.65 KB

File metadata and controls

167 lines (155 loc) · 9.65 KB

Camel CXFRS Demo :: A Red Hat JBoss Fuse 6.3.0 RESTful client for the IPSERVICE CXFRS Server exposed behind an SSL-enabled fabric8 gateway

  • This project can be deployed both in a Red Hat JBoss Fuse 6.3.0 standalone karaf container or in a Fabric8-managed cluster environment.

  • The request parameters to call the IpService CXFRS server are fetched from a JSON file. Below is an example in the JSON format:

    {
      "parameters": [
        {
          "ip_or_hostname": "",
          "response_type": "xml"
        },
        {
          "ip_or_hostname": "redhat.com",
          "response_type": "json"
        },
        {
          "ip_or_hostname": "org.example",
          "response_type": "csv"
        },
        {
          "ip_or_hostname": "ipstack.com",
          "response_type": "xml"
        }
      ]
    }

⚠️ Attention:

The IpService CXFRS server will be called ONLY IF the input JSON file is valid according to the inputMessageSchema.json JSON schema.

The Everit JSON validator library is used for JSON validation.

Deployment in a standalone instance of Red Hat Fuse 6.3.0 on Apache Karaf

Assumptions

  • Red Hat JBoss Fuse 6.3.0 Rollup 19 (v6.3.0.redhat-515) on Apache Karaf is installed and running in standalone mode
  • Red Hat JBoss AMQ broker is either running inside in the Red Hat JBoss Fuse 6.3.0 Rollup 19 (v6.3.0.redhat-515) on Apache Karaf (embedded) or is running as a standalone instance
  • The project has been built for a standalone deployment

Deployment instructions

  • Create the org.jeannyil.fuse.demo.ipservicecxfrsclient.cfg Persistent ID file in the <red_hat_fuse_install_directory>/etc directory with the following content:
    context.name.application=demo-ipservice_cxfrs_client
    camel.name.route=demo-ipservice_cxfrs_client-route
    notif.amq.destination=queue://IPSERVICE.CXFRSCLIENT.NOTIF.QUEUE
    error.amq.destination=queue://IPSERVICE.CXFRSCLIENT.ERROR.QUEUE
    amqclient.ssl.truststore=/home/jEAN/mnt/nfsshare/security/fuse-standalone.lab.com/jboss-fuse/app-truststore.jks
    amqclient.ssl.truststore.password=P@ssw0rd
    broker.out.url=failover:(ssl://amq-standalone.lab.com:61443)
    broker.user.name=amq
    broker.user.password=amq@standalone
    broker.max.connections=1
    broker.max.activesessionperconnection=500
    http.client.connection.timeout.inms=60000
    http.client.receive.timeout.inms=120000
    output.message.ttl.inms=3600000
    json.file.input.path=/Users/jnyilimb/workdata/ipservice_cxfrs_client/in
    json.file.error.path=/Users/jnyilimb/workdata/ipservice_cxfrs_client/error
    restful.service.base.url=https://fuse-standalone.lab.com:8443/cxf/demorest
    restful.service.ssl.truststore=/Users/jnyilimb/workdata/truststore/truststore.jks
    restful.service.ssl.truststore.password=P@ssw0rd
    
  • Adapt the following properties according to your run-time environment:
    • amqclient.ssl.truststore: path to the truststore containing the AMQ broker public certificate
    • amqclient.ssl.truststore.password: password of the truststore
    • broker.out.url: Red Hat JBoss AMQ broker connection url (openwire)
    • broker.user.name and broker.user.password: credentials to connect to the Red Hat JBoss AMQ broker
    • json.file.input.path and json.file.error.path: working directories (respectively input and error) for the ipservice_cxfrs_client bundle
    • restful.service.base.url: base URL of the the ipservice_cxfrs_server RESTful service
    • restful.service.ssl.truststore: path to the truststore containing the ipservice_cxfrs_server RESTful service public certificate
    • restful.service.ssl.truststore.password: password of the truststore
  • Log into the Red Hat Fuse Karaf terminal and deploy the ipservice_cxfrs_clientfeature:
    $ features:addurl mvn:org.jeannyil.fuse/ipservice_cxfrs_client/1.0.0-SNAPSHOT/xml/features
    $ features:install ipservice_cxfrs_client
    

Deployment in a fabric8-managed cluster of Red Hat Fuse 6.3.0 on Apache Karaf

Assumptions

  • A fabric8-managed cluster of Red Hat JBoss Fuse 6.3.0 Rollup 19 (v6.3.0.redhat-515) is running
  • Red Hat JBoss AMQ broker is either running within the fabric8-managed cluster of Red Hat JBoss Fuse 6.3.0 Rollup 19 (v6.3.0.redhat-515) or as a standalone instance outside the fabric8 cluster
  • The project has been built for a Red Hat Fuse fabric8-managed cluster deployment
  • All the generated fabric8 profiles have been imported (See instructions here)

Deployment instructions

  • Log into the Red Hat Fuse fabric8 terminal
  • Use the fabric:profile-edit command (example: fabric:profile-edit -p org.jeannyil.fuse.cxfrs.demo/broker.user.name=amq org-jeannyil-fuse-cxfrs-demo) to adapt some Persistent ID properties as indicated for the following fabric8 profiles:
    • org-jeannyil-fuse-cxfrs-demo fabric8 profile
      • Adapt these org.jeannyil.fuse.cxfrs.demo Persistent ID properties:
        • amqclient.ssl.truststore: path to the truststore containing the AMQ broker public certificate
        • amqclient.ssl.truststore.password: password of the truststore
        • broker.out.url: Red Hat JBoss AMQ broker connection url (openwire)
        • broker.user.name and broker.user.password: credentials to connect to the Red Hat JBoss AMQ broker
      • Below is an extract of my org-jeannyil-fuse-cxfrs-demo fabric8 profile:
        $ fabric:profile-display org-jeannyil-fuse-cxfrs-demo
        Profile id: org-jeannyil-fuse-cxfrs-demo
        [...]
        Configuration details
        ----------------------------
        PID: org.jeannyil.fuse.cxfrs.demo
          broker.out.url discovery:(fabric://ssl-demo-broker)
          amqclient.ssl.truststore /home/jEAN/mnt/nfsshare/security/jboss-fuse/truststore.jks
          broker.max.activesessionperconnection 500
          broker.max.connections 1
          broker.user.name amq
          broker.user.password amq@fabric
          amqclient.ssl.truststore.password P@ssw0rd
          output.message.ttl.inms 3600000
        [...]
        
    • org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_client fabric8 profile
      • Adapt these org.jeannyil.fuse.demo.ipservicecxfrsclient Persistent ID properties:
        • json.file.input.path and json.file.error.path: working directories (respectively input and error) for the ipservice_cxfrs_client bundle
        • restful.service.base.url: base URL of the the ipservice_cxfrs_server RESTful service
        • restful.service.ssl.truststore: path to the truststore containing the ipservice_cxfrs_server RESTful service public certificate
        • restful.service.ssl.truststore.password: password of the truststore
      • Below is an extract of my org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_client fabric8 profiles:
        $ fabric:profile-display org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_client
        Profile id: org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_client
        [...]
        Configuration details
        ----------------------------
        PID: org.jeannyil.fuse.demo.ipservicecxfrsclient
          error.amq.destination queue://IPSERVICE.CXFRSCLIENT.ERROR.QUEUE
          broker.out.url ${profile:org.jeannyil.fuse.cxfrs.demo/broker.out.url}
          restful.service.ssl.truststore /home/jEAN/mnt/nfsshare/security/jboss-fuse/truststore.jks
          broker.max.activesessionperconnection ${profile:org.jeannyil.fuse.cxfrs.demo/broker.max.activesessionperconnection}
          broker.max.connections ${profile:org.jeannyil.fuse.cxfrs.demo/broker.max.connections}
          restful.service.ssl.truststore.password P@ssw0rd
          http.client.receive.timeout.inms 120000
          restful.service.base.url https://fuse-01.lab.com:9095/version/1.0/cxf/demorest
          notif.amq.destination queue://IPSERVICE.CXFRSCLIENT.NOTIF.QUEUE
          broker.user.password ${profile:org.jeannyil.fuse.cxfrs.demo/broker.user.password}
          amqclient.ssl.truststore.password ${profile:org.jeannyil.fuse.cxfrs.demo/amqclient.ssl.truststore.password}
          amqclient.ssl.truststore ${profile:org.jeannyil.fuse.cxfrs.demo/amqclient.ssl.truststore}
          context.name.application demo-ipservice_cxfrs_client
          broker.user.name ${profile:org.jeannyil.fuse.cxfrs.demo/broker.user.name}
          http.client.connection.timeout.inms 60000
          json.file.input.path /home/jEAN/mnt/nfsshare/working/fuse-fabric8.lab.com/workingDir/in
          json.file.error.path /home/jEAN/mnt/nfsshare/working/fuse-fabric8.lab.com/workingDir/error
          camel.name.route demo-ipservice_cxfrs_client-route
          output.message.ttl.inms ${profile:org.jeannyil.fuse.cxfrs.demo/output.message.ttl.inms}
        [...]
        
  • Deploy the org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_clientfabric8 profile:
    • On an existing fabric8 karaf container using the fabric:container-add-profile command. Example:
      $ fabric:container-add-profile cxfrs_client-node org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_client
      
    • Or, create a new fabric8 karaf container and assign the profile using the fabric:container-create-child command. Example:
      $ fabric:container-create-child --profile org-jeannyil-fuse-cxfrs-demo-ipservice_cxfrs_client fuse-01-root cxfrs_client-node
      

🚧 README TO BE COMPLETED with tests samples for both standalone and fabric8 deployments...