mirror of
https://github.com/corda/corda.git
synced 2025-06-06 09:21:47 +00:00
This reverts commit ed3944c54606e876abd6483ff5d66a764f9cf577.
This commit is contained in:
parent
4fb7f7d3d0
commit
92f59f2ad2
@ -190,7 +190,7 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
|
|
||||||
if (!configuration.messagingServerExternal) {
|
if (!configuration.messagingServerExternal) {
|
||||||
val brokerBindAddress = configuration.messagingServerAddress ?: NetworkHostAndPort("0.0.0.0", configuration.p2pAddress.port)
|
val brokerBindAddress = configuration.messagingServerAddress ?: NetworkHostAndPort("0.0.0.0", configuration.p2pAddress.port)
|
||||||
messageBroker = ArtemisMessagingServer(configuration, brokerBindAddress, networkParameters.maxMessageSize, info.legalIdentities.map { it.owningKey })
|
messageBroker = ArtemisMessagingServer(configuration, brokerBindAddress, networkParameters.maxMessageSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
val serverAddress = configuration.messagingServerAddress
|
val serverAddress = configuration.messagingServerAddress
|
||||||
|
@ -15,18 +15,14 @@ import net.corda.node.services.config.NodeConfiguration
|
|||||||
import net.corda.nodeapi.ArtemisTcpTransport.Companion.p2pAcceptorTcpTransport
|
import net.corda.nodeapi.ArtemisTcpTransport.Companion.p2pAcceptorTcpTransport
|
||||||
import net.corda.nodeapi.internal.AmqpMessageSizeChecksInterceptor
|
import net.corda.nodeapi.internal.AmqpMessageSizeChecksInterceptor
|
||||||
import net.corda.nodeapi.internal.ArtemisMessageSizeChecksInterceptor
|
import net.corda.nodeapi.internal.ArtemisMessageSizeChecksInterceptor
|
||||||
import net.corda.nodeapi.internal.ArtemisMessagingComponent
|
|
||||||
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.INTERNAL_PREFIX
|
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.INTERNAL_PREFIX
|
||||||
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.JOURNAL_HEADER_SIZE
|
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.JOURNAL_HEADER_SIZE
|
||||||
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.NOTIFICATIONS_ADDRESS
|
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.NOTIFICATIONS_ADDRESS
|
||||||
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.P2P_PREFIX
|
import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.P2P_PREFIX
|
||||||
import net.corda.nodeapi.internal.requireOnDefaultFileSystem
|
import net.corda.nodeapi.internal.requireOnDefaultFileSystem
|
||||||
import org.apache.activemq.artemis.api.core.RoutingType
|
|
||||||
import org.apache.activemq.artemis.api.core.SimpleString
|
import org.apache.activemq.artemis.api.core.SimpleString
|
||||||
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl
|
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl
|
||||||
import org.apache.activemq.artemis.core.config.Configuration
|
import org.apache.activemq.artemis.core.config.Configuration
|
||||||
import org.apache.activemq.artemis.core.config.CoreAddressConfiguration
|
|
||||||
import org.apache.activemq.artemis.core.config.CoreQueueConfiguration
|
|
||||||
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl
|
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl
|
||||||
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration
|
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration
|
||||||
import org.apache.activemq.artemis.core.security.Role
|
import org.apache.activemq.artemis.core.security.Role
|
||||||
@ -35,7 +31,6 @@ import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl
|
|||||||
import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager
|
import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.security.KeyStoreException
|
import java.security.KeyStoreException
|
||||||
import java.security.PublicKey
|
|
||||||
import javax.annotation.concurrent.ThreadSafe
|
import javax.annotation.concurrent.ThreadSafe
|
||||||
import javax.security.auth.login.AppConfigurationEntry
|
import javax.security.auth.login.AppConfigurationEntry
|
||||||
import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag.REQUIRED
|
import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag.REQUIRED
|
||||||
@ -56,8 +51,7 @@ import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag.RE
|
|||||||
@ThreadSafe
|
@ThreadSafe
|
||||||
class ArtemisMessagingServer(private val config: NodeConfiguration,
|
class ArtemisMessagingServer(private val config: NodeConfiguration,
|
||||||
private val messagingServerAddress: NetworkHostAndPort,
|
private val messagingServerAddress: NetworkHostAndPort,
|
||||||
private val maxMessageSize: Int,
|
private val maxMessageSize: Int) : ArtemisBroker, SingletonSerializeAsToken() {
|
||||||
private val identities: List<PublicKey> = emptyList()) : ArtemisBroker, SingletonSerializeAsToken() {
|
|
||||||
companion object {
|
companion object {
|
||||||
private val log = contextLogger()
|
private val log = contextLogger()
|
||||||
}
|
}
|
||||||
@ -121,23 +115,7 @@ class ArtemisMessagingServer(private val config: NodeConfiguration,
|
|||||||
log.info("P2P messaging server listening on $messagingServerAddress")
|
log.info("P2P messaging server listening on $messagingServerAddress")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createArtemisConfig(): Configuration {
|
private fun createArtemisConfig() = SecureArtemisConfiguration().apply {
|
||||||
val addressConfigs = identities.map {
|
|
||||||
val queueName = ArtemisMessagingComponent.RemoteInboxAddress(it).queueName
|
|
||||||
log.info("Configuring address $queueName")
|
|
||||||
val queueConfig = CoreQueueConfiguration().apply {
|
|
||||||
address = queueName
|
|
||||||
name = queueName
|
|
||||||
routingType = RoutingType.ANYCAST
|
|
||||||
isExclusive = true
|
|
||||||
}
|
|
||||||
CoreAddressConfiguration().apply {
|
|
||||||
name = queueName
|
|
||||||
queueConfigurations = listOf(queueConfig)
|
|
||||||
addRoutingType(RoutingType.ANYCAST)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return SecureArtemisConfiguration().apply {
|
|
||||||
val artemisDir = config.baseDirectory / "artemis"
|
val artemisDir = config.baseDirectory / "artemis"
|
||||||
bindingsDirectory = (artemisDir / "bindings").toString()
|
bindingsDirectory = (artemisDir / "bindings").toString()
|
||||||
journalDirectory = (artemisDir / "journal").toString()
|
journalDirectory = (artemisDir / "journal").toString()
|
||||||
@ -152,7 +130,6 @@ class ArtemisMessagingServer(private val config: NodeConfiguration,
|
|||||||
journalBufferSize_AIO = maxMessageSize + JOURNAL_HEADER_SIZE // Required to address IllegalArgumentException (when Artemis uses Linux Async IO): Record is too large to store.
|
journalBufferSize_AIO = maxMessageSize + JOURNAL_HEADER_SIZE // Required to address IllegalArgumentException (when Artemis uses Linux Async IO): Record is too large to store.
|
||||||
journalFileSize = maxMessageSize + JOURNAL_HEADER_SIZE// The size of each journal file in bytes. Artemis default is 10MiB.
|
journalFileSize = maxMessageSize + JOURNAL_HEADER_SIZE// The size of each journal file in bytes. Artemis default is 10MiB.
|
||||||
managementNotificationAddress = SimpleString(NOTIFICATIONS_ADDRESS)
|
managementNotificationAddress = SimpleString(NOTIFICATIONS_ADDRESS)
|
||||||
addressConfigurations = addressConfigs
|
|
||||||
|
|
||||||
// JMX enablement
|
// JMX enablement
|
||||||
if (config.jmxMonitoringHttpPort != null) {
|
if (config.jmxMonitoringHttpPort != null) {
|
||||||
@ -161,7 +138,6 @@ class ArtemisMessagingServer(private val config: NodeConfiguration,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}.configureAddressSecurity()
|
}.configureAddressSecurity()
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticated clients connecting to us fall in one of the following groups:
|
* Authenticated clients connecting to us fall in one of the following groups:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user