use of org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding in project activemq-artemis by apache.
the class TopicCleanupTest method testSendTopic.
@Test
public void testSendTopic() throws Exception {
Topic topic = createTopic("topic");
Connection conn = cf.createConnection();
try {
conn.setClientID("someID");
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = sess.createDurableSubscriber(topic, "someSub");
conn.start();
MessageProducer prod = sess.createProducer(topic);
TextMessage msg1 = sess.createTextMessage("text");
prod.send(msg1);
assertNotNull(cons.receive(5000));
conn.close();
StorageManager storage = server.getStorageManager();
for (int i = 0; i < 100; i++) {
long txid = storage.generateID();
final Queue queue = new QueueImpl(storage.generateID(), SimpleString.toSimpleString("topic"), SimpleString.toSimpleString("topic"), FilterImpl.createFilter(Filter.GENERIC_IGNORED_FILTER), null, true, false, false, server.getScheduledPool(), server.getPostOffice(), storage, server.getAddressSettingsRepository(), server.getExecutorFactory().getExecutor(), server, null);
LocalQueueBinding binding = new LocalQueueBinding(queue.getAddress(), queue, server.getNodeID());
storage.addQueueBinding(txid, binding);
storage.commitBindings(txid);
}
jmsServer.stop();
jmsServer.start();
} finally {
try {
conn.close();
} catch (Throwable igonred) {
}
}
}
Aggregations