use of org.apache.activemq.command.ActiveMQQueue in project ignite by apache.
the class IgniteJmsStreamerTest method testQueueFromExplicitDestination.
/**
* @throws Exception If failed.
*/
public void testQueueFromExplicitDestination() throws Exception {
Destination dest = new ActiveMQQueue(QUEUE_NAME);
// produce messages into the queue
produceObjectMessages(dest, false);
try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
// subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
// start the streamer
jmsStreamer.start();
// all cache PUT events received in 10 seconds
latch.await(10, TimeUnit.SECONDS);
assertAllCacheEntriesLoaded();
jmsStreamer.stop();
}
}
Aggregations