Make webserver reconnect to rebooted node. (#662)

This commit is contained in:
Andrzej Cichocki
2017-05-12 10:27:27 +01:00
committed by GitHub
parent 8cb7c5eab1
commit 1df29ab06f
5 changed files with 58 additions and 2 deletions

View File

@ -108,6 +108,7 @@ interface RPCDriverExposedDSLInterface : DriverDSLExposedInterface {
maxFileSize: Int = ArtemisMessagingServer.MAX_FILE_SIZE,
maxBufferedBytesPerClient: Long = 10L * ArtemisMessagingServer.MAX_FILE_SIZE,
configuration: RPCServerConfiguration = RPCServerConfiguration.default,
customPort: HostAndPort? = null,
ops : I
) : ListenableFuture<RpcServerHandle>
@ -340,9 +341,10 @@ data class RPCDriverDSL(
maxFileSize: Int,
maxBufferedBytesPerClient: Long,
configuration: RPCServerConfiguration,
customPort: HostAndPort?,
ops: I
): ListenableFuture<RpcServerHandle> {
val hostAndPort = driverDSL.portAllocation.nextHostAndPort()
val hostAndPort = customPort ?: driverDSL.portAllocation.nextHostAndPort()
addressMustNotBeBound(driverDSL.executorService, hostAndPort)
return driverDSL.executorService.submit<RpcServerHandle> {
val artemisConfig = createRpcServerArtemisConfig(maxFileSize, maxBufferedBytesPerClient, driverDSL.driverDirectory / serverName, hostAndPort)