elasticsearchdockerwildflydocker-composeapiman

connecting APIMAN to an external ElasticSearch database for metrics


I'm trying to connect APIMAN to an external Elastic Search database using Docker-compose. I've met some issues (see log output below). Here are the configurations :

-apiman.properties

apiman.es.protocol=http
apiman.es.host=MY_MACHINE_HOST
apiman.es.port=9200
apiman.es.username=elasticsearch
apiman.es.password=
apiman.es.timeout=10000

apiman-manager.metrics.type=es
apiman-manager.metrics.es.client-factory=
apiman-manager.metrics.es.protocol=${apiman.es.protocol}
apiman-manager.metrics.es.host=${apiman.es.host}
apiman-manager.metrics.es.port=${apiman.es.port}
apiman-manager.metrics.es.username=${apiman.es.username}
apiman-manager.metrics.es.password=${apiman.es.password}
apiman-manager.metrics.es.timeout=${apiman.es.timeout}

ETC...

-and the logs

 ERROR [io.undertow.request] (default task-28) UT005023: Exception handling request to /apiman/organizations/test/apis/test/versions/1.0/metrics/planUsage: org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: java.lang.IllegalArgumentException: name is empty
    at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76)
    at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212)
    at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411)
ETC...

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: name is empty
    at io.apiman.manager.api.war.WarCdiFactory.provideMetricsESClientFactory(WarCdiFactory.java:255)
    at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
    at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:99)
    at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:161)
ETC...

Caused by: java.lang.IllegalArgumentException: name is empty
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:344)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

And here is the docker-compose configuration :

apiman:
  build: ./docker/apiman/
  links:
    - elastic:elastic
  ports:
    - "8060:8080"
    - "8443:8443"
elastic:
  image: elasticsearch
  ports:
    - "9200:9200"

Am I doing something wrong ? Any help would be greatly appreciated.


Solution

  • Try leaving apiman-manager.metrics.es.client-factory= commented out, otherwise you're trying to override the default with an empty string (or other non-existent thing).