Avoid duplicate script
This commit avoids a script duplication: the integration test runs the sample instead of a copy of it in the repro directory. Also switched the sample from ActiveMQ to HornetQ as #323 revealed some locking on CI. Hopefully that should fix it as HornetQ is non persistent and can be embedded several times in the same VM. Fixes gh-1456pull/1476/head
parent
0dc389f5b3
commit
85c95744f9
@ -1,33 +0,0 @@
|
||||
package org.test
|
||||
|
||||
@Grab("org.apache.activemq:activemq-all:5.4.0")
|
||||
@Grab("activemq-pool")
|
||||
import java.util.concurrent.CountDownLatch
|
||||
|
||||
@Log
|
||||
@EnableJms
|
||||
class SampleJmsListener implements CommandLineRunner {
|
||||
|
||||
private CountDownLatch latch = new CountDownLatch(1)
|
||||
|
||||
@Autowired
|
||||
JmsTemplate jmsTemplate
|
||||
|
||||
void run(String... args) {
|
||||
def messageCreator = { session ->
|
||||
session.createObjectMessage("Hello World")
|
||||
} as MessageCreator
|
||||
log.info "Sending JMS message..."
|
||||
jmsTemplate.send("testQueue", messageCreator)
|
||||
log.info "Sent JMS message, waiting..."
|
||||
latch.await()
|
||||
}
|
||||
|
||||
@JmsListener(destination = 'testQueue')
|
||||
def receive(String message) {
|
||||
log.info "Received ${message}"
|
||||
latch.countDown()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue