From 92a7363c830c46eb0feffa494157c5528a88357c Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Tue, 8 Mar 2016 17:27:05 +0100 Subject: [PATCH] Minor: add a couple more utilities for converting strings into the type safe endpoint address objects --- src/main/kotlin/core/node/services/ArtemisMessagingService.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/core/node/services/ArtemisMessagingService.kt b/src/main/kotlin/core/node/services/ArtemisMessagingService.kt index cc0fa633c5..8d58a42ebe 100644 --- a/src/main/kotlin/core/node/services/ArtemisMessagingService.kt +++ b/src/main/kotlin/core/node/services/ArtemisMessagingService.kt @@ -12,6 +12,7 @@ import com.google.common.net.HostAndPort import core.RunOnCallerThread import core.ThreadBox import core.messaging.* +import core.node.Node import core.utilities.loggerFor import org.apache.activemq.artemis.api.core.SimpleString import org.apache.activemq.artemis.api.core.TransportConfiguration @@ -68,6 +69,8 @@ class ArtemisMessagingService(val directory: Path, val myHostPort: HostAndPort) /** Temp helper until network map is established. */ fun makeRecipient(hostAndPort: HostAndPort): SingleMessageRecipient = Address(hostAndPort) + fun makeRecipient(hostname: String) = makeRecipient(toHostAndPort(hostname)) + fun toHostAndPort(hostname: String) = HostAndPort.fromString(hostname).withDefaultPort(Node.DEFAULT_PORT) } private lateinit var mq: EmbeddedActiveMQ