Service discovery fails in Java based but works with golang

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

I have different services deployed on Istio mesh (1.7). I have two golang microservices, they can access to services using http.Get() method. add, err := http.PostForm(“http://addmodule:7070/add”, url.Values{“num1”: {numNew1}}) This can access to addmodule and addmoudle does computations. But in java based microservices, it fails to get service name. Here Java services uses configmaps to apiVersion: v1 kind: ConfigMap metadata: name: services-configmap data: sms-server: http://192.168.100.123:8083/vxSmpp/sendSms source: “444” Deployment for spring app apiVersion: apps/v1 kind: Deployment metadata: name: sms-service spec: selector: matchLabels: app: sms-sender-backend replicas: 1 template: metadata: labels: app: sms-sender-backend spec: containers: – name: sms-sender image: docker-registry:5000/my-image ports: …… – name: SMS_SERVER valueFrom: configMapKeyRef: name: services-configmap key: sms-server Property file in springboot “` server: port: 9090 spring: application: name: Notification-Sender jpa: hibernate: ddl-auto: update smsSender: token: ${TOKEN} url: ${SMS_SERVER} source: ${SOURCE} “` In application uses : String url = env.getProperty(“smsSender.url”); HttpEntity<Map<String, Object>> entity = new HttpEntity<>(map, httpHeaders); ResponseEntity<String> response = restTemplate.postForEntity(url, entity, String.class); But I can not access to service using this, only available if we change to clusterIP address of this service. What are we missing? why its working with golang and not springboot? submitted by /u/sachithmuhandiram [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

Allow service account to do operations on namespaces that do not exist yet

Wed Sep 16 , 2020
Spread the love          I have a azure pipeline agent running on my Kubernetes cluster that I use to run my integration tests. Some context: First thing in the pipeline the agent creates a new namespace and then deploys all the services on it using a helm task. Then it runs the […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM