-
Notifications
You must be signed in to change notification settings - Fork 11
automatic registration in the vertx ServiceDiscovery #9
Comments
That's very interesting, except I think the But certainly, it would be useful to declare services with an annotation. I think the name should be enough, the rest we can get from the config. |
Yes, the host/port/root parts are always derived from server config and @path annotations. |
Sure, but they don't belong in the annotation if the framework can detect them. Unless they're not required/defaulted. |
If you like my idea, i can try to write my first extension on redpipe: redpipe-servicediscovery, dependent from redpipe-cdi. We need to initialize in some point: Two annotations:
@ServiceClient(name="name") The example use for service: and for the client: serviceClient.subscribe((client) -> { what do you think about it? |
Yes this sounds great. |
work in progress: |
Another suggestion:
the automatic registration of rest service on ServiceDiscovery should be interesting.
for example:
@ServiceDiscovery("api.name", "host", port, "root")
@path("/")
public FlowerService {
}
translated in vertx:
Record record = HttpEndpoint.createRecord(name, host, port, root, new JsonObject().put("api.name", name));
serviceDiscovery = ServiceDiscovery.create(vertx, new ServiceDiscoveryOptions().setBackendConfiguration(config()));
serviceDiscovery.publish(record, ar ->
{
if (ar.succeeded())
{
registeredRecords.add(record);
logger.info("Service <" + ar.result().getName() + "> published");
future.complete();
}
else
{
future.fail(ar.cause());
}
});
what do you think about it?
The text was updated successfully, but these errors were encountered: