engagingspaces / vertx-graphql-service-discovery

Service discovery and querying of GraphQL schema's in Vert.x based microservices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsupported service type graphql-service

crazyfrozenpenguin opened this issue · comments

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:?]

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.

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

It's a maven shade problem.
Change your transformer to this :
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource> <resource>META-INF/services/io.vertx.servicediscovery.spi.ServiceType</resource> </transformer>
will solve the problem by merging io.vertx.servicediscovery.spi.ServiceType files, so graphql-service wil be detected.

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?

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

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