Coder Social home page Coder Social logo

ibm-cloud-architecture / refarch-jee-micro-customer-service Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 4.0 27 KB

A component of the https://github.com/ibm-cloud-architecture/refarch-jee reference application. This repository contains the detail of the new Customer microservice during the evolution of an existing JEE monolith to microservices.

License: Apache License 2.0

Java 90.89% Shell 1.53% Dockerfile 7.58%

refarch-jee-micro-customer-service's Introduction

Overview

CustomerOrderService is a microservice that redirects service requests from BFF layer to Legacy Backend Layer. This service is introduced to implement Strangler Pattern. Currently it only redirects the requests to EJB layer. In future it can be used to redirect requests to new implementations of services using new technologies e.g. nodejs and nosql

The CustomerOrderService exposes the following interfaces

  • /Customer
  • /Customer/Address
  • /Customer/OpenOrder/LineItem
  • /Customer/OpenOrder/LineItem/id
  • /Customer/OpenOrder
  • /Customer/Orders
  • /Customer/TypeForm
  • /Customer/Info

Configuration

One configuration parameter that this micro service requires is the IP address of the EJB services host. The EJB services host IP address is specified in the environment variables of this application. The environment variable goes as EJBServiceIP=""


Build WAR using Maven

  1. Ensure maven is installed
  2. On command prompt, navigate to CustomerOrderService project
  3. Run "mvn clean package" command
  4. CustomerOrderService-0.1.war is created under CustomerOrderService/target directory
  5. Use this war file for deploying the CustomerOrderService module on app server

Security Configuration in server.xml

The backend services are secured with basic authentication. Hence the intermediate REST service layer also needs to be secured. Add the following Basic Registry in server.xml file

<ldapRegistry baseDN="dc=purplecompute,dc=com" bindDN="cn=admin,dc=purplecompute,dc=com" bindPassword="{xor}Dz4sLChvLTs=" host="<ldap-server ip>" id="ldap" ignoreCase="true" ldapType="Custom" port="31252" realm="<ldap-server ip>:31252" searchTimeout="8m">
 
    <contextPool enabled="true" initialSize="1" maxSize="0" preferredSize="3" timeout="0s" waitTime="3000ms"/>
    
    <ldapCache>
        <attributesCache enabled="true" size="4000" sizeLimit="2000" timeout="1200s"/>
        <searchResultsCache enabled="true" resultsSizeLimit="1000" size="2000" timeout="600s"/>
    </ldapCache>

</ldapRegistry>

Challenges resolved:
1) Client application expects "ETag" header and it's value to be present in response headers. Hence had to 1) Pass the value from client to EJB Layer and then 2) Extract the Etag header value from response of EJB layer to the client (again as ETag header in response to client)

refarch-jee-micro-customer-service's People

Contributors

debasisdas1976 avatar osowski avatar

Stargazers

Prafull Kotecha avatar František Špaček avatar

Watchers

James Cloos avatar Gang Chen avatar Hans Kristian Moen avatar Jerome Boyer avatar  avatar Ray Stoner avatar  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.