apache - Lost message when stoping and restarting Embedded ActiveMQ -
hi trying write test-case implementing fail on support activemq. here code val brokera = createbroker("a") brokera.start val failoverurl = s"failover:(vm://brokera?create=false)" + s"?randomize=false&maxreconnectattempts=-1&reconnectsupported=true" val cfactory = new activemqconnectionfactory(failoverurl) val qconnection = getqueueconnection val session = createqueuesession(qconnection) private def totalreadmessagescount(queuereceiver: queuereceiver) = { val messages = iterator.continually(option(queuereceiver.receive(2000))).takewhile(_.isdefined).flatten.toseq messages.size } private def getreceiver = { val queueconnection = getqueueconnection queueconnection.start() val queuesession = queueconnection.createqueuesession(false, session.auto_acknowledge) val queuereceiver = createqueuereceiver(queuesession, brokera.getbrokername) queuereceiver } def getqueueconnection =cfactory.createqueueconnection("admin", "") de...