I have a service called Identity from which I want to invoke another service called Notification. Both services are built with Java 11
, Micronaut 2.0.0
and are to be deployed on kubernetes
.
The Notification service's kubernetes manifest look like this-
apiVersion: apps/v1
kind: Deployment
metadata:
name: notification-service
labels:
app: notification-service
spec:
selector:
matchLabels:
app: notification-service
template:
metadata:
labels:
app: notification-service
spec:
containers:
- name: notification-service
image: notification-service
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 3
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 3
failureThreshold: 10
---
apiVersion: v1
kind: Service
metadata:
name: notification-service
spec:
type: NodePort
selector:
app: notification-service
ports:
- port: 8080
protocol: TCP
To invoke this service, I have added a declarative client in Identity service as follows-
@Client(id="notification-service")
public interface NotificationClient {
@Get("/health")
String checkHealth();
}
Whenever I invoke the checkHealth()
method after injecting it in any service or controller, the request gets stuck.
The invocation works fine if I make the call from any service with Micronaut version 1.3.x.
Can anyone help with this?