Skip to content
Permalink
Browse files

Merge branch 'release-3.x'

  • Loading branch information
atooni committed Nov 19, 2019
2 parents e74a604 + 6f47acb commit 97721c0781b2d7b57fb311dd08968e06c890757f
Showing with 1,278 additions and 781 deletions.
  1. +1 −0 ....activemq.brokerstarter/src/main/scala/blended/activemq/brokerstarter/internal/BrokerConfig.scala
  2. +1 −2 ...okerstarter/src/main/scala/blended/activemq/brokerstarter/internal/JaasAuthenticatingBroker.scala
  3. +1 −1 ...mq.brokerstarter/src/test/scala/blended/activemq/brokerstarter/internal/BrokerActivatorSpec.scala
  4. +9 −7 blended.activemq.client/src/main/scala/blended/activemq/client/RoundtripConnectionVerifier.scala
  5. +6 −5 ....akka.http.jmsqueue/src/test/scala/blended/akka/http/jmsqueue/internal/HttpQueueServiceSpec.scala
  6. +8 −7 ....akka.http.jmsqueue/src/test/scala/blended/akka/http/jmsqueue/internal/SttpQueueServiceSpec.scala
  7. +1 −0 blended.akka.http.restjms/src/main/scala/blended/akka/http/restjms/internal/RestJMSConfig.scala
  8. +9 −8 ...ed.akka.http.restjms/src/main/scala/blended/akka/http/restjms/internal/SimpleRestJmsService.scala
  9. +1 −2 blended.akka.http.restjms/src/test/scala/blended/akka/http/restjms/internal/JMSRequestorSpec.scala
  10. +6 −5 blended.akka.http.restjms/src/test/scala/blended/akka/http/restjms/internal/JmsResponder.scala
  11. +104 −0 blended.akka.logging/src/main/scala/blended/akka/logging/BlendedLogger.scala
  12. +6 −0 ...ntext.impl/src/main/scala/blended/container/context/impl/internal/ContainerContextActivator.scala
  13. +10 −9 blended.file/src/main/scala/blended/file/EnvelopeFileDropper.scala
  14. +116 −46 blended.file/src/main/scala/blended/file/FileDropActor.scala
  15. +8 −8 blended.file/src/main/scala/blended/file/FileDropStage.scala
  16. +70 −19 blended.file/src/test/scala/blended/file/FileDropSpec.scala
  17. +4 −4 blended.file/src/test/scala/blended/file/FileDropStageSpec.scala
  18. +1 −1 blended.jms.bridge/src/main/scala/blended/jms/bridge/BridgeProviderConfig.scala
  19. +1 −2 blended.jms.bridge/src/main/scala/blended/jms/bridge/internal/BridgeController.scala
  20. +37 −15 blended.jms.bridge/src/main/scala/blended/jms/bridge/internal/BridgeStreamBuilder.scala
  21. +8 −6 blended.jms.bridge/src/main/scala/blended/jms/bridge/internal/JmsRetryProcessor.scala
  22. +4 −4 blended.jms.bridge/src/main/scala/blended/jms/bridge/internal/JmsRetryRouter.scala
  23. +6 −5 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/BridgeSpecSupport.scala
  24. +2 −2 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/InboundBridgeTrackedSpec.scala
  25. +1 −1 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/InboundConfigSpec.scala
  26. +9 −9 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/JmsRetryProcessorSpec.scala
  27. +8 −7 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/JmsRetryRouterSpec.scala
  28. +1 −1 blended.jms.utils/src/main/scala/blended/jms/utils/BlendedJMSConnectionConfig.scala
  29. +1 −1 blended.jms.utils/src/main/scala/blended/jms/utils/internal/ConnectionMonitor.scala
  30. +2 −2 blended.jms.utils/src/main/scala/blended/jms/utils/internal/JmsConnectionController.scala
  31. +1 −1 blended.jms.utils/src/test/scala/blended/jms/utils/internal/JmsConnectionControllerSpec.scala
  32. +2 −2 blended.jmx/jvm/src/main/scala/blended/jmx/JmxAttributeCompanion.scala
  33. +1 −1 blended.jmx/jvm/src/main/scala/blended/jmx/JmxObjectNameCompanion.scala
  34. +2 −2 blended.jmx/jvm/src/main/scala/blended/jmx/MBeanRegistrationSupport.scala
  35. +2 −2 blended.jmx/jvm/src/main/scala/blended/jmx/OpenMBeanExporter.scala
  36. +2 −2 blended.jmx/jvm/src/main/scala/blended/jmx/internal/BlendedMBeanServerFacadeImpl.scala
  37. +1 −1 blended.jmx/jvm/src/main/scala/blended/jmx/internal/GenericImmutableOpenMBean.scala
  38. +2 −2 blended.jmx/jvm/src/main/scala/blended/jmx/internal/OpenMBeanExporterImpl.scala
  39. +5 −6 blended.jmx/jvm/src/main/scala/blended/jmx/internal/OpenMBeanMapperImpl.scala
  40. +2 −1 blended.jmx/jvm/src/main/scala/blended/jmx/statistics/StatisticsActor.scala
  41. +2 −2 blended.jmx/jvm/src/test/scala/blended/jmx/JmxAttributeCompanionSpec.scala
  42. +1 −1 blended.jmx/jvm/src/test/scala/blended/jmx/MbeanServerFacadeSpec.scala
  43. +1 −0 blended.jmx/jvm/src/test/scala/blended/jmx/internal/JmxActivatorSpec.scala
  44. +4 −6 blended.jmx/jvm/src/test/scala/blended/jmx/internal/OpenMBeanMapperSpec.scala
  45. +1 −2 blended.jmx/jvm/src/test/scala/blended/jmx/internal/TestData.scala
  46. +1 −1 blended.jmx/jvm/src/test/scala/blended/jmx/statistics/StatisticsActorSpec.scala
  47. +1 −1 blended.jmx/shared/src/main/scala/blended/jmx/json/PrickleProtocol.scala
  48. +1 −1 blended.launcher/src/main/scala/blended/launcher/Launcher.scala
  49. +7 −0 blended.launcher/src/runner/resources/bin/blended.bat
  50. +7 −0 blended.launcher/src/runner/resources/bin/blended.sh
  51. +8 −1 blended.launcher/src/runner/resources/bin/install-service.bat
  52. +1 −2 blended.mgmt.agent/src/main/scala/blended/mgmt/agent/internal/MgmtReporter.scala
  53. +1 −2 blended.mgmt.agent/src/main/scala/blended/mgmt/agent/internal/OsgiMgmtReporter.scala
  54. +1 −1 blended.mgmt.repo/src/main/scala/blended/mgmt/repo/internal/ArtifactRepoActivator.scala
  55. +1 −1 blended.mgmt.service.jmx/src/main/scala/blended/mgmt/service/jmx/internal/ServiceJmxConfig.scala
  56. +1 −1 blended.persistence.h2/src/test/scala/blended/persistence/jdbc/DummyPlatformTransactionManager.scala
  57. +1 −1 blended.security.akka.http/src/main/scala/blended/security/akka/http/JAASSecurityDirectives.scala
  58. +1 −1 blended.security.login.impl/src/main/scala/blended/security/login/impl/SimpleTokenStore.scala
  59. +2 −2 blended.security.login.rest/src/main/scala/blended/security/login/rest/internal/LoginService.scala
  60. +1 −1 ...ed.security.login.rest/src/test/scala/blended/security/login/rest/internal/LoginServiceSpec.scala
  61. +1 −1 blended.security.scep.standalone/src/main/scala/blended/security/scep/standalone/ScepClientApp.scala
  62. +4 −6 ...d.streams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/DispatcherActivator.scala
  63. +11 −10 ...d.streams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/CbeSendFlow.scala
  64. +14 −13 ...ams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherBuilder.scala
  65. +12 −15 ...patcher/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherBuilderSupport.scala
  66. +7 −5 ...er/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherDestinationResolver.scala
  67. +19 −18 ...eams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherFanout.scala
  68. +9 −8 ...ams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherInbound.scala
  69. +13 −10 ...ms.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherOutbound.scala
  70. +4 −3 ...d.streams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/LogEnvelope.scala
  71. +46 −28 ...ms.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/RunnableDispatcher.scala
  72. +6 −6 ...s.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/TransactionOutbound.scala
  73. +8 −8 ...reams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/DispatcherActivatorSpec.scala
  74. +3 −5 ...d.streams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/CbeFlowSpec.scala
  75. +5 −4 ...ms.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/CoreDispatcherSpec.scala
  76. +8 −5 ...ispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/DispatcherOutboundSpec.scala
  77. +2 −2 ...treams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/DispatcherSpec.scala
  78. +12 −5 ...dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/DispatcherSpecSupport.scala
  79. +10 −11 ...ed.streams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/FanoutSpec.scala
  80. +5 −5 ...spatcher/src/test/scala/blended/streams/dispatcher/internal/builder/TransactionOutboundSpec.scala
  81. +2 −2 ...patcher/src/test/scala/blended/streams/dispatcher/internal/builder/WorklistEventhandlerSpec.scala
  82. +1 −1 blended.streams.testsupport/src/main/scala/blended/streams/testsupport/FlowMessageAssertion.scala
  83. +7 −6 blended.streams.testsupport/src/main/scala/blended/streams/testsupport/RoundtripHelper.scala
  84. +41 −39 blended.streams/src/main/scala/blended/streams/AckSourceLogic.scala
  85. +1 −1 blended.streams/src/main/scala/blended/streams/BlendedStreamsConfig.scala
  86. +1 −1 blended.streams/src/main/scala/blended/streams/FlowHeaderConfig.scala
  87. +18 −27 blended.streams/src/main/scala/blended/streams/FlowProcessor.scala
  88. +1 −1 blended.streams/src/main/scala/blended/streams/file/DirectorySource.scala
  89. +28 −32 blended.streams/src/main/scala/blended/streams/file/FileAckSource.scala
  90. +1 −1 blended.streams/src/main/scala/blended/streams/file/FilePollConfig.scala
  91. +9 −5 blended.streams/src/main/scala/blended/streams/internal/BlendedStreamsActivator.scala
  92. +1 −1 blended.streams/src/main/scala/blended/streams/jms/JmsConnector.scala
  93. +22 −22 blended.streams/src/main/scala/blended/streams/jms/JmsConsumerStage.scala
  94. +1 −1 blended.streams/src/main/scala/blended/streams/jms/JmsDestinationResolver.scala
  95. +15 −12 blended.streams/src/main/scala/blended/streams/jms/JmsProducerStage.scala
  96. +18 −12 blended.streams/src/main/scala/blended/streams/jms/JmsSettings.scala
  97. +7 −8 blended.streams/src/main/scala/blended/streams/jms/JmsStreamSupport.scala
  98. +3 −3 blended.streams/src/main/scala/blended/streams/jms/internal/StreamKeepAliveProducerFactory.scala
  99. +41 −0 blended.streams/src/main/scala/blended/streams/message/FlowEnvelopeLogger.scala
  100. +1 −2 blended.streams/src/main/scala/blended/streams/message/FlowMessage.scala
  101. +16 −17 blended.streams/src/main/scala/blended/streams/multiresult/MultiResultCollector.scala
  102. +2 −2 blended.streams/src/main/scala/blended/streams/multiresult/MultiResultProcessor.scala
  103. +1 −2 blended.streams/src/main/scala/blended/streams/processor/CollectingActor.scala
  104. +15 −14 blended.streams/src/main/scala/blended/streams/processor/HeaderTransformProcessor.scala
  105. +24 −13 blended.streams/src/main/scala/blended/streams/transaction/FlowTransactionStream.scala
  106. +12 −11 blended.streams/src/main/scala/blended/streams/transaction/TransactionWiretap.scala
  107. +1 −1 blended.streams/src/main/scala/blended/streams/transaction/internal/FileFlowTransactionManager.scala
  108. +9 −10 blended.streams/src/main/scala/blended/streams/worklist/Worklist.scala
  109. +6 −5 blended.streams/src/test/scala/blended/streams/AckSourceLogicSpec.scala
  110. +7 −6 blended.streams/src/test/scala/blended/streams/file/AbstractFileSourceSpec.scala
  111. +7 −9 blended.streams/src/test/scala/blended/streams/file/FileSourceSpec.scala
  112. +9 −10 blended.streams/src/test/scala/blended/streams/file/JmsFileSourceSpec.scala
  113. +1 −1 blended.streams/src/test/scala/blended/streams/file/ParallelFileSourceSpec.scala
  114. +8 −7 blended.streams/src/test/scala/blended/streams/jms/JmsAckSourceSpec.scala
  115. +2 −2 blended.streams/src/test/scala/blended/streams/jms/internal/JmsKeepAliveActorSpec.scala
  116. +10 −9 blended.streams/src/test/scala/blended/streams/jms/internal/StreamKeepAliveProducerFactorySpec.scala
  117. +2 −2 blended.streams/src/test/scala/blended/streams/json/PrickleProtocolSpec.scala
  118. +1 −1 blended.streams/src/test/scala/blended/streams/message/FlowMessageSpec.scala
  119. +5 −4 blended.streams/src/test/scala/blended/streams/multiresult/MultiResultProcessorSpec.scala
  120. +11 −9 blended.streams/src/test/scala/blended/streams/processor/FlowProcessorSpec.scala
  121. +11 −6 blended.streams/src/test/scala/blended/streams/processor/HeaderProcessorSpec.scala
  122. +1 −1 blended.streams/src/test/scala/blended/streams/transaction/FlowTransactionSpec.scala
  123. +2 −2 blended.streams/src/test/scala/blended/streams/transaction/FlowTransactionStreamSpec.scala
  124. +5 −1 blended.streams/src/test/scala/blended/streams/worklist/WorklistSpec.scala
  125. +1 −1 blended.testsupport.pojosr/src/main/scala/blended/testsupport/pojosr/SimplePojoContainerSpec.scala
  126. +1 −0 blended.testsupport/src/main/scala/blended/testsupport/FileTestSupport.scala
  127. +1 −1 blended.testsupport/src/main/scala/blended/testsupport/retry/Retry.scala
  128. +1 −1 blended.updater/src/main/scala/blended/updater/internal/BlendedUpdaterActivator.scala
  129. +1 −1 blended.updater/src/main/scala/blended/updater/internal/Commands.scala
  130. +47 −5 blended.util.logging/src/main/scala/blended/util/logging/Logger.scala
  131. +52 −20 blended.util.logging/src/main/scala/blended/util/logging/LoggerSlf4j.scala
  132. +2 −2 blended.websocket/jvm/src/main/scala/blended/websocket/internal/BlendedCommandPackage.scala
  133. +1 −1 blended.websocket/jvm/src/main/scala/blended/websocket/internal/JmxCommandPackage.scala
  134. +1 −1 blended.websocket/jvm/src/main/scala/blended/websocket/internal/WebSocketActivator.scala
  135. +1 −1 blended.websocket/jvm/src/main/scala/blended/websocket/internal/WebSocketSubscriptionManager.scala
  136. +2 −2 blended.websocket/jvm/src/test/scala/blended/websocket/internal/AbstractWebSocketSpec.scala
  137. +1 −1 blended.websocket/jvm/src/test/scala/blended/websocket/internal/JmxCommandPackageSpec.scala
  138. +1 −2 blended.websocket/shared/src/main/scala/blended/websocket/json/PrickleProtocol.scala
  139. +1 −1 blended.websocket/shared/src/test/scala/blended/websocket/JsonSpec.scala
  140. +0 −5 blended.ws.jmx/src/main/scala/blended/ws/jmx/internal/JmxQueryCommandHandler.scala
  141. +0 −4 blended.ws.jmx/src/main/scala/blended/ws/jmx/internal/JmxRefreshActor.scala
  142. +2 −0 build.sbt
  143. +1 −1 project/BlendedActivemqBrokerstarter.scala
  144. +1 −1 project/BlendedAkkaHttpProxy.scala
  145. +1 −1 project/BlendedAkkaHttpRestjms.scala
  146. +29 −0 project/BlendedAkkaSlf4j.scala
  147. +1 −1 project/BlendedJmsUtils.scala
  148. +3 −3 project/BlendedJmx.scala
  149. +1 −1 project/BlendedJolokia.scala
  150. +15 −1 project/BlendedLauncher.scala
  151. +6 −6 project/BlendedWebsocket.scala
  152. +1 −0 project/CommonSettings.scala
  153. +11 −1 project/Dependencies.scala
@@ -5,6 +5,7 @@ import blended.jms.utils.{BlendedJMSConnectionConfig, ConnectionConfig}
import blended.util.config.Implicits._
import com.typesafe.config.Config
import org.apache.activemq.ActiveMQConnectionFactory

import scala.concurrent.duration.FiniteDuration
import scala.util.Try

@@ -5,8 +5,6 @@ import java.security.cert.X509Certificate
import java.util

import blended.security.PasswordCallbackHandler

import scala.collection.JavaConverters._
import blended.security.boot.GroupPrincipal
import blended.util.logging.Logger
import javax.security.auth.Subject
@@ -15,6 +13,7 @@ import org.apache.activemq.broker.{Broker, ConnectionContext}
import org.apache.activemq.command.ConnectionInfo
import org.apache.activemq.security.{AbstractAuthenticationBroker, SecurityContext}

import scala.collection.JavaConverters._
import scala.util.control.NonFatal
import scala.util.{Failure, Success, Try}

@@ -5,7 +5,7 @@ import java.io.File
import akka.actor.ActorSystem
import akka.testkit.TestProbe
import blended.akka.internal.BlendedAkkaActivator
import blended.jms.utils.{Connected, ConnectionStateChanged, IdAwareConnectionFactory}
import blended.jms.utils.{Connected, ConnectionStateChanged}
import blended.security.internal.SecurityActivator
import blended.testsupport.pojosr.{PojoSrTestHelper, SimplePojoContainerSpec}
import blended.testsupport.scalatest.LoggingFreeSpecLike
@@ -6,11 +6,11 @@ import akka.actor.ActorSystem
import akka.pattern.after
import akka.stream.{ActorMaterializer, Materializer}
import blended.jms.utils.{IdAwareConnectionFactory, JmsDestination}
import blended.streams.FlowHeaderConfig
import blended.streams.jms.{JmsEnvelopeHeader, JmsProducerSettings, JmsStreamSupport, MessageDestinationResolver}
import blended.streams.message.FlowEnvelope
import blended.streams.message.{FlowEnvelope, FlowEnvelopeLogger}
import blended.streams.processor.Collector
import blended.streams.FlowHeaderConfig
import blended.util.logging.Logger
import blended.util.logging.{LogLevel, Logger}

import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future, Promise}
@@ -29,6 +29,7 @@ class RoundtripConnectionVerifier(
with JmsEnvelopeHeader {

private val log : Logger = Logger[RoundtripConnectionVerifier]
private val envLogger : FlowEnvelopeLogger = FlowEnvelopeLogger.create(headerConfig, log)
private val verified : Promise[Boolean] = Promise[Boolean]()

override def verifyConnection(cf : IdAwareConnectionFactory)(implicit eCtxt : ExecutionContext) : Future[Boolean] = {
@@ -53,17 +54,18 @@ class RoundtripConnectionVerifier(
.withHeader(replyToHeader(headerConfig.prefix), responseDest.asString).get

val pSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerConfig,
connectionFactory = cf,
jmsDestination = Some(requestDest),
timeToLive = Some(receiveTimeout * 2),
destinationResolver = s => new MessageDestinationResolver(s)
destinationResolver = s => new MessageDestinationResolver(s),
logLevel = _ => LogLevel.Debug
)

log.info(s"Running verification probe for connection [${cf.vendor}:${cf.provider}]")

sendMessages(pSettings, log, probeEnv) match {
sendMessages(pSettings, envLogger, probeEnv) match {
case Success(s) =>
log.info(s"Request message sent successfully to [${requestDest.asString}] : [$probeEnv]")
s.shutdown()
@@ -72,7 +74,7 @@ class RoundtripConnectionVerifier(
headerCfg = headerConfig,
cf = cf,
dest = responseDest,
log = log,
log = envLogger,
listener = 1,
selector = Some(s"JMSCorrelationID='$id'"),
timeout = Some(receiveTimeout)
@@ -8,7 +8,7 @@ import akka.util.ByteString
import blended.jms.utils.{IdAwareConnectionFactory, JmsQueue}
import blended.streams.FlowHeaderConfig
import blended.streams.jms.{JmsProducerSettings, JmsStreamSupport}
import blended.streams.message.{FlowEnvelope, FlowMessage}
import blended.streams.message.{FlowEnvelope, FlowEnvelopeLogger, FlowMessage}
import blended.util.logging.Logger
import com.typesafe.config.ConfigFactory
import javax.jms.ConnectionFactory
@@ -32,6 +32,7 @@ class HttpQueueServiceSpec extends FreeSpec
private val cf : IdAwareConnectionFactory = amqCf()

private val headerCfg : FlowHeaderConfig = FlowHeaderConfig.create("App")
private val envLogger : FlowEnvelopeLogger = FlowEnvelopeLogger.create(headerCfg, log)

override protected def afterAll() : Unit = {
stopBroker(broker)
@@ -83,13 +84,13 @@ class HttpQueueServiceSpec extends FreeSpec
val env : FlowEnvelope = FlowEnvelope(FlowMessage(msg)(FlowMessage.noProps))

val pSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = cf,
jmsDestination = Some(JmsQueue("Queue1"))
)

sendMessages(pSettings, log, env)
sendMessages(pSettings, envLogger, env)

Get(s"/activemq/Queue1") ~> route ~> check {
val r = response
@@ -108,13 +109,13 @@ class HttpQueueServiceSpec extends FreeSpec
val env : FlowEnvelope = FlowEnvelope(FlowMessage(ByteString(msg))(FlowMessage.noProps))

val pSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = cf,
jmsDestination = Some(JmsQueue("Queue1"))
)

sendMessages(pSettings, log, env)
sendMessages(pSettings, envLogger, env)

Get(s"/activemq/Queue1") ~> route ~> check {
val r = response
@@ -14,7 +14,7 @@ import blended.akka.internal.BlendedAkkaActivator
import blended.jms.utils.{IdAwareConnectionFactory, JmsQueue}
import blended.streams.FlowHeaderConfig
import blended.streams.jms.{JmsProducerSettings, JmsStreamSupport}
import blended.streams.message.{FlowEnvelope, FlowMessage}
import blended.streams.message.{FlowEnvelope, FlowEnvelopeLogger, FlowMessage}
import blended.testsupport.BlendedTestSupport
import blended.testsupport.pojosr.{PojoSrTestHelper, SimplePojoContainerSpec}
import blended.testsupport.scalatest.LoggingFreeSpecLike
@@ -42,6 +42,7 @@ class SttpQueueServiceSpec extends SimplePojoContainerSpec
private val svcUrlBase : String = "http://localhost:9995/httpqueue"

private val headerCfg : FlowHeaderConfig = FlowHeaderConfig.create("App")
private val envLogger : FlowEnvelopeLogger = FlowEnvelopeLogger.create(headerCfg, log)

override def baseDir : String = new File(BlendedTestSupport.projectTestOutput, "container").getAbsolutePath()

@@ -94,13 +95,13 @@ class SttpQueueServiceSpec extends SimplePojoContainerSpec
val env : FlowEnvelope = FlowEnvelope(FlowMessage(msg)(FlowMessage.noProps))

val pSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = amqCF,
jmsDestination = Some(JmsQueue("Queue1"))
)

sendMessages(pSettings, log, env)
sendMessages(pSettings, envLogger, env)

val request = sttp.get(Uri(new URI(s"$svcUrlBase/blended/Queue1")))
val response = request.send()
@@ -117,13 +118,13 @@ class SttpQueueServiceSpec extends SimplePojoContainerSpec
val env : FlowEnvelope = FlowEnvelope(FlowMessage(ByteString(msg))(FlowMessage.noProps))

val pSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = amqCF,
jmsDestination = Some(JmsQueue("Queue1"))
)

sendMessages(pSettings, log, env)
sendMessages(pSettings, envLogger, env)

val request = sttp.get(Uri(new URI(s"$svcUrlBase/blended/Queue1")))
val response = request.send()
@@ -141,13 +142,13 @@ class SttpQueueServiceSpec extends SimplePojoContainerSpec
)

val pSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = amqCF,
jmsDestination = Some(JmsQueue("Queue1"))
)

sendMessages(pSettings, log, env)
sendMessages(pSettings, envLogger, env)

val request = sttp.get(Uri(new URI(s"$svcUrlBase/blended/Queue1")))
val response = request.send()
@@ -2,6 +2,7 @@ package blended.akka.http.restjms.internal

import blended.util.config.Implicits._
import com.typesafe.config.Config

import scala.collection.JavaConverters._

object RestJMSConfig {
@@ -4,19 +4,19 @@ import akka.actor.{ActorRef, ActorSystem}
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.stream.{ActorMaterializer, Materializer, OverflowStrategy}
import akka.stream.scaladsl.{Flow, Sink, Source}
import akka.stream.{ActorMaterializer, Materializer, OverflowStrategy}
import akka.util.ByteString
import blended.akka.OSGIActorConfig
import blended.jms.utils.{IdAwareConnectionFactory, JmsDestination, JmsQueue}
import blended.streams.jms.{JmsConsumerSettings, JmsConsumerStage, JmsEnvelopeHeader, JmsProducerSettings, JmsProducerStage, MessageDestinationResolver, PassThroughKeyFormatStrategy}
import blended.streams.message.{BinaryFlowMessage, FlowEnvelope, FlowMessage, MsgProperty, TextFlowMessage}
import blended.streams.jms._
import blended.streams.message.{BinaryFlowMessage, FlowEnvelope, FlowEnvelopeLogger, FlowMessage, TextFlowMessage}
import blended.streams.{BlendedStreamsConfig, FlowHeaderConfig, FlowProcessor, StreamController}
import blended.util.logging.{LogLevel, Logger}

import scala.collection.mutable
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.util.{Failure, Success, Try}

class SimpleRestJmsService(
@@ -30,6 +30,7 @@ class SimpleRestJmsService(
private implicit val materializer : Materializer = ActorMaterializer()
private implicit val eCtxt : ExecutionContext = system.dispatcher
private val log : Logger = Logger(s"${getClass().getName()}.$name")
private val envLogger : FlowEnvelopeLogger = FlowEnvelopeLogger.create(FlowHeaderConfig.create(osgiCfg.idSvc), log)

private val defaultContentTypes = List("application/json", "text/xml")
private val restConfig : RestJMSConfig = RestJMSConfig.fromConfig(osgiCfg.config)
@@ -43,19 +44,19 @@ class SimpleRestJmsService(
private val pendingRequests : mutable.Map[String, (HttpRequest, Promise[HttpResponse])] = mutable.Map.empty

private val producerSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = cf,
destinationResolver = s => new MessageDestinationResolver(s),
keyFormatStrategy = new PassThroughKeyFormatStrategy()
)

private val consumerSettings : JmsConsumerSettings = JmsConsumerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = cf,
jmsDestination = Some(responseDestination),
receiveLogLevel = LogLevel.Debug,
logLevel = _ => LogLevel.Debug,
selector = Some(s"${corrIdHeader(headerCfg.prefix)} = '${osgiCfg.idSvc.uuid}'"),
keyFormatStrategy = new PassThroughKeyFormatStrategy()
)
@@ -64,7 +65,7 @@ class SimpleRestJmsService(

private val responseSrc : Source[FlowEnvelope, NotUsed] =
Source.fromGraph(new JmsConsumerStage(s"$name-response", consumerSettings))
.via(FlowProcessor.fromFunction("handleResponse", log){ env => Try {
.via(FlowProcessor.fromFunction("handleResponse", envLogger){ env => Try {
handleResponse(env)
env
}})
@@ -2,8 +2,7 @@ package blended.akka.http.restjms.internal

import java.net.URI

import com.softwaremill.sttp._
import com.softwaremill.sttp.{StatusCodes => SttpStatusCodes}
import com.softwaremill.sttp.{StatusCodes => SttpStatusCodes, _}

class JMSRequestorSpec extends AbstractJmsRequestorSpec {

@@ -6,9 +6,9 @@ import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Flow, Source}
import blended.container.context.api.ContainerIdentifierService
import blended.jms.utils.{IdAwareConnectionFactory, JmsQueue}
import blended.streams.jms.{JmsConsumerSettings, JmsConsumerStage, JmsEnvelopeHeader, JmsProducerSettings, JmsProducerStage, MessageDestinationResolver}
import blended.streams.jms._
import blended.streams.message.{FlowEnvelope, FlowEnvelopeLogger, FlowMessage}
import blended.streams.{BlendedStreamsConfig, FlowHeaderConfig, FlowProcessor, StreamController}
import blended.streams.message.{FlowEnvelope, FlowMessage}
import blended.util.logging.Logger

import scala.concurrent.duration._
@@ -32,16 +32,17 @@ class JMSResponder(
private val log : Logger = Logger[JMSResponder]
private var streamActor : Option[ActorRef] = None
private val headerCfg : FlowHeaderConfig = FlowHeaderConfig.create(idSvc)
private val envLogger : FlowEnvelopeLogger = FlowEnvelopeLogger.create(headerCfg, log)

private val consumerSettings : JmsConsumerSettings = JmsConsumerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = cf,
jmsDestination = Some(JmsQueue("redeem"))
)

private val producerSettings : JmsProducerSettings = JmsProducerSettings(
log = log,
log = envLogger,
headerCfg = headerCfg,
connectionFactory = cf,
destinationResolver = s => new MessageDestinationResolver(s)
@@ -50,7 +51,7 @@ class JMSResponder(
def start() : Unit = {
val src : Source[FlowEnvelope, NotUsed] =
Source.fromGraph(new JmsConsumerStage("requestor-src", consumerSettings, None))
.via(FlowProcessor.fromFunction("respond", log){ env => Try {
.via(FlowProcessor.fromFunction("respond", envLogger){ env => Try {
val body : String = env.header[String]("Content-Type") match {
case Some("text/xml") => MockResponses.xml
case Some("application/json") => MockResponses.json

0 comments on commit 97721c0

Please sign in to comment.
You can’t perform that action at this time.