CRecordRemoveMicroServiceInstance
When a microservice instance is removed, this message notifies the microservice registry. The registry will then delete the reference to this instance as well.
This message belongs to the microservice registry API.
{
"id": "faf04666-44a8-418f-91d6-3c78eb35cbfc",
"name": "REMOVE_MICRO_SERVICE_INSTANCE",
"description": "Remove a single microservice instance.",
"isNanoService": "false",
"slots": [
{
"key": "1",
"name": "MICRO_SERVICE_ID",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "ID",
"description": "The ID of the microservice."
},
{
"key": "2",
"name": "MICRO_SERVICE_INSTANCE_ID",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "ID",
"description": "The ID of the microservice instance."
}
]
}
Slot Description
| Key | Name | Direction | Presence Constraint | Type | Description |
|---|---|---|---|---|---|
| 1 | MICRO_SERVICE_ID | REQUEST | true | ID | The ID of the microservice. |
| 2 | MICRO_SERVICE_INSTANCE_ID | REQUEST | true | ID | The ID of the microservice instance. |
Usage
Example of use (after generating of the class CRecordRemoveMicroServiceInstance):
private void sendRemoveMicroService(@NotNull final CTargetAddress aAddressOfMicroserviceRegistry,
@NotNull final IId aMicroserviceId,
@NotNull final IId aMicroserviceInstanceId) throws CException
{
final CEnvelope env = CEnvelope.forSingleTarget(aAddressOfMicroserviceRegistry);
final CRecord rec = CRecordRemoveMicroServiceInstance.create();
CRecordRemoveMicroServiceInstance.setMicroServiceId(rec,
aMicroserviceId);
CRecordRemoveMicroServiceInstance.setMicroServiceInstanceId(rec,
aMicroserviceInstanceId);
sendRequest(env,
rec);
}
Record Usage
In nyssr.net, we typically don't exchange interfaces between projects. Instead, we use platform-independent Records to describe message formats.
One or more descriptions of these Records are stored in the JSON or XML format
as record.json or record.xml within a directory.
The Record Generator, an included Swing tool, generates helper classes from these files.
These classes can then be used to type-safely write or read messages.