Wednesday, April 22, 2020

Adaptor


  • Adaptor
  • Environment
  • ELP Adaptor Framework
  • What we have done
  • Solving Issues
  • Useful Links


Adaptor Pattern

  • Why we need ?
    • Two parties , incompatible with each other
    • Since they are incompatible --> Need Adaptor --> CONVERTS One to Another

  • Flow
    • The client makes a request to the adapter by calling a method on it using the target interface.
    • The adapter translates that request on the adaptee using the adaptee interface.
    • Client receive the results of the call and is unaware of adapter’s presence.
Envronment Set up

  • Need two Vms { Windows,Dev}{Linux,Docker}
  • Set up ActiveMQ -  windows vm
    • https://activemq.apache.org/components/classic/download/
  • Code base
    • Perforce: //Source_Code/ELP-Customisation/Elnino/Adaptors/
  • Jboss : deploy mock service
    • https://wildfly.org/downloads/
    • Deployment folder : %JBoss_Install_Location%\standalone\deployments
    • Start Jboss : %JBoss_Install_Location%\bin\standalone.bat 
  • Gradle

ELP Adaptors - Framework
  • Apache camel Route
    • simplest form, an Adapter will receive a message at an input endpoint and send it to an output endpoint.

  • Adapter will be required to do some processing 
    • on the input message before sending to the output endpoint. 
      • implement a single instance of the AdapterRequestProcessor interface

    • send a message to a synchronous output endpoint, and process a response from that endpoint, before sending the response to another output endpoint. 
      • AdapterResponseProcessor 
What else can be done
  • Adaptor Can
    • Decrypt incoming messages
    • Encrypt Outgoing messages
    • Aggregate result to a single route

Solve certificate Issue

  1. Copy certificate to local machine
  2. Import into your JVM trust store using administrator command prompt
    • Import
"C:\Program Files\Java\jdk1.8.0_201\bin\keytool.exe" -import -file "%Path_To_Cert%" -alias "localhost" -keystore "C:\Program Files\Java\jdk1.8.0_201\jre\lib\security\cacerts“

    • Delete
"C:\Program Files\Java\jdk1.8.0_201\bin\keytool.exe" -delete -alias "localhost" -keystore "C:\Program Files\Java\jdk1.8.0_201\jre\lib\security\cacerts"


https://www.enterpriseintegrationpatterns.com/
https://www.enterpriseintegrationpatterns.com/patterns/messaging/
https://camel.apache.org/manual/latest/routes.html
https://activemq.apache.org/getting-started



No comments:

Post a Comment