Skip to content
Toby Thanathip edited this page Apr 12, 2024 · 6 revisions

Run Multiple Projects Locally

Let's say we need to add a new endpoint, most of the time this will require updates in all three layers:

  1. Experience Layer
  2. Process Layer
  3. System Layer

A common scenario arises when a developer has created a pull request for one layer (example: System Layer), but must wait for it to be deployed before testing the changes on the next layer (example: Process Layer).

By running multiple projects locally, we can unblock the developer and test connected layers more thoroughly.

Let's say we want to run jfc-global-client-exp-api & jfc-global-order-proc-api at the same time, follow these steps:

Sender : client-exp-api

  • Update jfc-global-client-exp-api/src/main/resources/properties/{ENV}-properties.yaml
orderProcApi:
- host: "jfc-global-order-proc-apse1-dev.sg-s1.cloudhub.io"
+ host: "localhost"
- basePath: "/"
+ basePath: ""
  timeout: "60000"
  retry:
    maxNumber: "1"
    intervalInMs: "3000"
  • Update jfc-global-client-exp-api/src/main/resources/properties/common-properties.yaml
orderProcApi:
- protocol: "HTTPS"
+ protocol: "HTTP"
  • Update jfc-global-client-exp-api/src/main/mule/common/global.xml
<http:request-config
  name="ORDER_PROC_API_HTTP_Request_configuration"
  doc:name="HTTP Request configuration">
  <http:request-connection
-   protocol="${orderProcApi.protocol}" host="${orderProcApi.host}"
-   tlsContext="${tlsContextConfig}" />
+   protocol="${orderProcApi.protocol}" host="${orderProcApi.host} port="8083" />
</http:request-config>

Receiver : order-proc-api

  • Update jfc-global-order-proc-api/src/main/resources/properties/{ENV}-properties.yaml
httpsListener:
- port: "8082"
+ port: "8083"
  • Update protocol to HTTP and remove tlsContext=HTTPS_TLS_config in jfc-global-order-proc-api/src/main/mule/order-proc-api.xml
<http:listener-config
  name="order-proc-api-httpListenerConfig">
  <http:listener-connection
    host="${httpsListener.host}" port="${httpsListener.port}"
-   protocol="HTTPS" tlsContext="HTTPS_TLS_config" />
+   protocol="HTTP" />
</http:listener-config>

If the project has not yet been refactored to APIKit, then update jfc-global-product-proc-api/src/main/mule/common/global.xml instead.

Anypoint Studio

Set-up a new run configuration by clicking "Run" → "Run Configurations..." from the top menu:

assets/images/Run-Multiple-Projects-Locally/Anypoint-Studio-Run-Multiple-Projects-Locally.png

Don't forget to set up your environment key before applying!

Note

Let's say you want to run more than two projects, to include jfc-global-cx-sys-api for example.

Then you must apply the same steps as mentioned above.

Clone this wiki locally