Skip to main content

Setup Java microservices

Pre-requisites

See Enterprise LastPass page for config files :)

Enterprise LastPass for Kubernetes config

Located in kubectl .kube config.

  1. Download and save the config file.
  2. Copy the config file to D:\Users\<USERNAME>\.kube\ in Windows or /home/<username>/.kube/ in linux.
  3. Verify that kubectl works by

Once you have kubectl installed and the config file saved in the correct location, verify that it works with

kubectl cluster-info

and try listing some pods with

kubectl get pods -n dsis-system

IntelliJ setup

  1. Open IntelliJ with cloned repo, e.g. microservice-log-transfer
  2. Navigate to File -> Settings -> Build, Execution, Deployment -> Maven. Make sure that these are pointing to the correct folder/file: image
  3. Navigate to File -> Project Structure -> Set SDK and Language Level: image
  4. Navigate to Current File (Top right) -> Edit Configurations -> Add New Configuration
  • Name = Your choice, e.g. the environment you're pointing to
  • Main class = com.lgc.dist.core.msp.grizzly.GrizzlyServer
  • Environment variables = get a copy of env variables, paste (make sure to separate each line with semi colon)
  1. Navigate to Maven-menu (M-symbol on the right) -> Click refresh symbol
  2. Install Lombok plugin
  3. After setup done in IntelliJ -> Port forward with kubectl (in Powershell):
# DSWC (assuming you use the file from LastPass)
kubectl config use-context dswc
kubectl port-forward service/dsdsedmdwp 32000:31000 -n dsis-system
#AkerBP (assuming you use the file from LastPass)
kubectl config use-context akerbp
kubectl port-forward service/dsdsedmakerbp242 31000:31000 -n dsis-system-akerbp242
  1. Run application with Play-symbol, should be getting "INFO: Global parameters generated" at the bottom of the output window if successful.

Restarting IntelliJ, clicking refresh-symbol or double-clicking clean / compile in Maven Lifecycle menu may fix errors that appear:

image

Getting the following error?

image

Go to pom.xml and change the version numbers of jersey-proxy-client and jersey-media-json-jackson to 2.39.1 (Don't commit pom.xml!) and then Maven clean + install.

Connecting...