Skip to content

Commit

Permalink
#13 Add ability to specify consul port
Browse files Browse the repository at this point in the history
Add enabled toggle for route and consul service
  • Loading branch information
sweetcabage committed Feb 6, 2017
1 parent 0bc4c99 commit 4cfedee
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.1.1
version=1.1.2
1 change: 1 addition & 0 deletions komock-core/mock_example.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
consul:
enabled: false
consulHost: 127.0.0.1
consulPort: 8500
services:
-
serviceId: customer-data-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import java.util.*
class ConsulServerProperties {
var enabled: Boolean = false
var consulHost = "localhost"
var consulPort = 8500
var services = ArrayList<ConsulServiceProperties>()
}

class ConsulServiceProperties {
var enabled: Boolean = true
var serviceId: String = "defaultConsulService"
var serviceName: String = "defaultConsulServiceName"
var servicePort: Int = 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.util.*
*/

class RouteProperties {
var enabled: Boolean = true
var httpMethod: String = ""
var url: String = ""
var contentType: String = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConsulRegistrar {
private val log = LoggerFactory.getLogger(this.javaClass)

fun register(consulServerProperties: ConsulServerProperties) {
val clientRegistrar = ConsulClient(consulServerProperties.consulHost)
val clientRegistrar = ConsulClient(consulServerProperties.consulHost, consulServerProperties.consulPort)
log.debug("Found: ${consulServerProperties.services.size} consul services")
for (consulService in consulServerProperties.services) {
val newService = NewService()
Expand Down

0 comments on commit 4cfedee

Please sign in to comment.