archived-codacy / scala-consul Goto Github PK
View Code? Open in Web Editor NEWConsul API for scala
License: Other
Consul API for scala
License: Other
Need to add support for index
querying and blocking queues
The default WSAPI requires an instance of a Play application which isn't available for all applications. I'll give this issue a try when I get a chance.
Hello,
I want to register scala service in consul. I am using scala-consul sdk to do so. I am using following code for registration:
//for scala-consul
val myConsul = new consul.Consul(InetAddress.getByName("X.X.X.X").asInstanceOf[Inet4Address],8500)
import myConsul.v1._
val myAddress = "127.0.0.1"
val myServicePort = 2552
val myServiceCheck = agent.service.httpCheck("http://0.0.0.0:2552/health","15s")
println("servicecheck:"+myServiceCheck)
val myService = agent.service.LocalService(ServiceId("myServiceId"),ServiceType("myTypeOfService"),Set(ServiceTag("MyTag")),Some(myServicePort),Some(myServiceCheck))
val status=agent.service.register(myService)
status.onComplete {
case Success(value) => println(s"Got the callback = $value")
case Failure(e) => e.printStackTrace
}
But I am getting Exception:
"Caused by: java.lang.RuntimeException: There is no started application"
it seems a bug in library because i am following same step as mentioned in documentation
With the update to the play dependencies it would be nice to get these changes into maven so that we can take advantage of the latest scala version. Right now my build fails because it can't find the 2.3.7 play version for scala 2.11.
I am trying to use scala-consul 2.0.2 which uses WS CLient as an input parameter, where can I find a usage example for the the same.
Am I missing something or does this library not work without the Play framework? When I try to do something basic (adding a kv entry) I get this exception thrown at me, which seems to be an exception of the Play Framework:
java.lang.RuntimeException: There is no started application
Using the following code snippet:
import java.net.InetAddress
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, ExecutionContext}
import scala.concurrent._
import ExecutionContext.Implicits.global
object FailMain extends App {
val cConsul = new consul.Consul(CONSUL_IP, CONSUL_PORT)
import cConsul.v1._
val fut = kv.put("testKey", "testValue")
Await.result(fut, Duration("10 seconds"))
}
What is your roadmap to upgrade this library to the play-* 2.5.x versions?
Noticed that this project is no longer maintained.
I would be interested in taking it over and maintaining it as we do use consul.
Many thanks.
Support for the locking command
https://www.consul.io/docs/commands/lock.html
would be very helpful.
Is there a reason why Consul constructor takes Inet4Address as a parameter? Why not InetAddress?
I think it would be much more convenient to have (host: String) in the constructor.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.