engagingspaces / vertx-graphql-service-discovery

Service discovery and querying of GraphQL schema's in Vert.x based microservices
Apache License 2.0
50 stars 8 forks source link

Unsupported service type graphql-service #4

Closed crazyfrozenpenguin closed 6 years ago

crazyfrozenpenguin commented 7 years ago

SchemaConsumer is throwing the following error when querying GraphQL:

Unsupported service type graphql-service

Any idea of what might be going on?

customer-service_1  | 21.11.2016 20:36:20.213 [vert.x-eventloop-thread-1] INFO  com.cfp.customer.service.CustomerServiceVerticle - Record: {"location":{"endpoint":"service.graphql.StaysQueries"},"metadata":{"serviceAddress":null,"publisherId":"b7b0c044-9a27-4b6c-a9ca-5b7a2d9337ba","mutations":[],"schemaName":null,"queries":["staysById","hotelsById","hotels","stays"],"exposeToGateway":false},"name":"StaysQueries","status":"UP","type":"graphql-service"}
customer-service_1  | 21.11.2016 20:36:20.215 [vert.x-eventloop-thread-1] INFO  com.cfp.customer.service.CustomerServiceVerticle - OK: Service StaysQueries is UP
customer-service_1  | 21.11.2016 20:36:20.227 [vert.x-eventloop-thread-1] ERROR io.vertx.core.eventbus.impl.HandlerRegistration - Failed to handleMessage
customer-service_1  | java.lang.IllegalArgumentException: Unsupported service type graphql-service
customer-service_1  |   at io.vertx.servicediscovery.impl.ServiceTypes.get(ServiceTypes.java:43) ~[app.jar:?]
customer-service_1  |   at io.vertx.servicediscovery.impl.DiscoveryImpl.getReferenceWithConfiguration(DiscoveryImpl.java:111) ~[app.jar:?]
customer-service_1  |   at io.vertx.servicediscovery.impl.DiscoveryImpl.getReference(DiscoveryImpl.java:106) ~[app.jar:?]
customer-service_1  |   at io.engagingspaces.graphql.discovery.impl.ManagedServiceDiscovery.getReference(ManagedServiceDiscovery.java:87) ~[app.jar:?]
crazyfrozenpenguin commented 7 years ago

Here's an example that can easily replicate the issue:

https://github.com/crazyfrozenpenguin/vertx-graphql-example

Build it using: mvn package Execute it using: ./docker/run.sh

Docker needs to be installed.

crazyfrozenpenguin commented 7 years ago

In addition, I've noticed that quite often that the SchemaHandler.schemaDiscoveryEvent is never executed.

Cafeinoman commented 7 years ago

It's a maven shade problem. Change your transformer to this : `

META-INF/services/io.vertx.core.spi.VerticleFactory META-INF/services/io.vertx.servicediscovery.spi.ServiceType

` will solve the problem by merging io.vertx.servicediscovery.spi.ServiceType files, so graphql-service wil be detected.

aschrijver commented 7 years ago

Hi @crazyfrozenpenguin,

Sorry for my late response, but GH does not notify on organization project changes. Did @Cafeinoman suggestion fix your issue?

BTW Did you see https://github.com/bmsantos/vertx-graphql-example with async support?

shaykhsalman commented 6 years ago

Is there any working simple project for vertx service discovery + graphQL?

aschrijver commented 6 years ago

hi @shaykhsalman

thanks for your interest :) not that i am aware of, but you could look at the tests and check the people that watched/starred the repo

i am closing this issue now, because its stale and @marcelalburg has PR'ed async execution support