use of io.nats.client.Connection in project camel by apache.
the class NatsConsumerLoadTest method testLoadConsumer.
@Test
public void testLoadConsumer() throws InterruptedException, IOException, TimeoutException {
mockResultEndpoint.setExpectedMessageCount(10000);
ConnectionFactory cf = new ConnectionFactory("nats://localhost:4222");
Connection connection = cf.createConnection();
for (int i = 0; i < 10000; i++) {
connection.publish("test", ("test" + i).getBytes());
}
mockResultEndpoint.assertIsSatisfied();
}
Aggregations